Since you're forwarding from Action to Action, you do have a minor issue.  Things
you set in the request will be reset after the forward.

Solution 1: add what you need to the session.
Solution 2: extend ActionForward with a subclass that takes a map of name value
pairs to stick in the request.  Override the getPath() method to return the path
for the forward, plus the query string to follow it.  (e.g. String getPath() {
returns something like /myAction.do?mapParam1=val1&mapParam2=val2 )

You'll probably want to create this ActionForward yourself (MyActionForward f =
new MyActionForward(path, paramMap) );  You just need to be careful that the
ActionForward doesn't get reused (for obvious reasons).  I believe that the
ActionForwards in struts are static so if you use mapping.findForward("foo"), and
then add params to that, I think other actions might see them.  I'm not sure.

You could probably write your action forward to take an action forward in its
constructor such that you can reuse the static one in your dynamic one (if it is
static indeed).  i.e., MyActionForward f = new MyActionForward
(mapping.findForward("foo"), Map paramMap)


cheers,
--Michael


Phase Communcations wrote:

> I am forwarding from one Action to Another. I need to tweak the request
> parameters. Is there a way to do this?
>
> I tried to set the reqest value by calling the FormBean and set it from the
> action. But, it doesn't carry over to the next Action. I can't find a way to
> change the request parameters. Please help.
>
> I saw some discussion on the archive. But, is pretty aimless and not very
> clear.
>
> I am running Servlet 2.2 so don't tell me about getParameterMap().
>
> Brandon Goodin
> Phase Web and Multimedia
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to