You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Cohan, Sean" <SC...@goSPS.com> on 2002/11/13 18:35:55 UTC
Parameter
I'm in one action class and I'm want to forward to another DispatchAction
class. The second DispatchAction class requires a 'method' parameter which
is used to determine which method to call within the DispatchAction. How
can I set the method parameter in the first action class so it can be used
by the DispatchAction?
Right now, I trying request.setAttribute("method",
"getChangesSinceLastCertified") just before forwarding, but I'm getting a
"HTTP Status 400 - Request[/recertify] does not contain handler parameter
named method".
Thanks.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Parameter
Posted by Gemes Tibor <ge...@regens.hu>.
2002-11-13, sze keltezéssel Cohan, Sean ezt írta:
> Right now, I trying request.setAttribute("method",
> "getChangesSinceLastCertified") just before forwarding, but I'm getting a
> "HTTP Status 400 - Request[/recertify] does not contain handler parameter
> named method".
You can get it with request.getAttribute("method") in the other action.
Hth,
Tib
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Parameter
Posted by Robert Taylor <rt...@mulework.com>.
Sean, the DispatchAction will "look" for the 'method' parameter in the HTTP
request query string, that's
why setting the value as a request attribute is not working.
So most likely you will have to do something like the following in your
action class.
ActionForward forward = // get forward
String path = forward.getPath();
path = new
StringBuffer(path).append("?method=").append(methodValue).toString();
forward = new ActionForward(path);
return forward;
This should create an action forward with a path that contains the
appropriate method
indicator in your HTTP request query string. The DispatchAction will get
invoked, find
the 'method' parameter and execute the appropriate operation.
> -----Original Message-----
> From: Cohan, Sean [mailto:SCohan@goSPS.com]
> Sent: Wednesday, November 13, 2002 12:36 PM
> To: Struts (E-mail)
> Subject: Parameter
>
>
> I'm in one action class and I'm want to forward to another DispatchAction
> class. The second DispatchAction class requires a 'method'
> parameter which
> is used to determine which method to call within the DispatchAction. How
> can I set the method parameter in the first action class so it can be used
> by the DispatchAction?
>
> Right now, I trying request.setAttribute("method",
> "getChangesSinceLastCertified") just before forwarding, but I'm getting a
> "HTTP Status 400 - Request[/recertify] does not contain handler parameter
> named method".
>
> Thanks.
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>