Servlet API doesn't allow you to write request attributes (parameters,
headers...)

You can try to forward to a new ActionForward object, build with the mapping
to your "another" action, adding needed parameter with GET syntax :
...
return new ActionForward( NEXT_ACTION_URL + "?param=" + paramValue );
(I'm not sure it will work...)


Another solution is to put param value in request and forward to a JSP that
will redirect browser to the NEXT_ACTION_URL with param added :

# in your action:
request.setAttribute("param", paramValue);
return new ActionForward( "redirect.jsp" );


# redirect.jsp :
<form action="NEXT_ACTION_URL" method="POST">
  <input type="hidden" value="<% request.getAttribute("param") %>">
</form>
<script>
    document.forms[0].submit();
</script>


Nico.

> Hi,
> in my action-class I can get a parameter from the request by using the
> method getParameter(String); from the class HttpServletRequest.
> But now I want to set a parameter (not an attribute) in my action and then
> make the forward so that another action can read this parameter.
>
> I need it because normally the action gets the parameter by the URL. But
in
> this special case I have to send the parameter by an action.
>
> ciao Oliver.
>
>
> --
> 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