RE: What is the best way to pass a parameter to a forward?

2004-03-16 Thread Jay Glanville
It's funny that you say that it will not work, because it does for me, and without throwing any exceptions. That being said, your point about modifying an action mappings forwards is a good one. It is unfortunate that the ActionForward class doesn't have a copy constructor -- Jay Glanville

RE: What is the best way to pass a parameter to a forward?

2004-03-16 Thread Hubert Rabago
I wrote an extension to help me do this. I use this in all my projects. http://www.rabago.net/struts/redirect hth, Hubert --- Jay Glanville [EMAIL PROTECTED] wrote: I'm trying to solve a problem, but I'm not sure my solution is the best way. Basically, I want to set a parameter on a

Re: What is the best way to pass a parameter to a forward?

2004-03-16 Thread Martin Cooper
Jay Glanville [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It's funny that you say that it will not work, because it does for me, and without throwing any exceptions. What version of Struts are you using? It's not supposed to work, at least with the latest code, so I'd like to

RE: What is the best way to pass a parameter to a forward?

2004-03-16 Thread Jay Glanville
Latest stable release: 1.1 -- Jay Glanville -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper Sent: Tuesday, March 16, 2004 1:33 PM To: [EMAIL PROTECTED] Subject: Re: What is the best way to pass a parameter to a forward? Jay Glanville [EMAIL

RE: What is the best way to pass a parameter to a forward?

2004-03-16 Thread Menke, John
i found this class a while ago on this list it works great, just create a parameter action forward and then add params forward.addParameter(name, value); return forward; import java.util.HashMap; import java.util.Iterator; public final class ParameterActionForward extends ActionForward {

RE: What is the best way to pass a parameter to a forward?

2004-03-15 Thread Gopalakrishnan, Jayesh
I have used this technique and it seems to be the only way to have the name/value pair be passed as request parameters. Don't think there's a request.setParameter() !! But request.get/setAttribute() would be the 'ideal' way to go. -jayash -Original Message- From: Glanville, Jay

Re: What is the best way to pass a parameter to a forward?

2004-03-15 Thread Joshua Tuberville
Jay, Since Struts does not differentiate between a POST and a GET, passing data as query parameters is the same as form data. You could create a form that has only the one field id which would be populated if you called a URL of /someAction?id=foo. This is what I use when I create dynamic

Re: What is the best way to pass a parameter to a forward?

2004-03-15 Thread Martin Cooper
What you are doing will not work - at least, not the way you are doing it. You are trying to modify the ActionForward instance that is owned by Struts, and calling setPath() on that instance will result in an IllegalStateException. You need to create your own ActionForward instance, instead of