> Sylvain Roche wrote:
> [...]
> I want to redirect in some cases the response of a jsp page to another
> one. In order to do that, and because I want to keep the parameters of
> the request, I use a jsp:forward. This works fine, except that I want to
> add one parameter. It suddenly becomes more complicated, as long as
> there is no way (maybe I didn't find it) to do such thing as a
> setParameter in a HttpServletRequest.
>
> Is there a smart way to do that ?
In JSP 1.0 you can transfer the new parameter as a request scope JavaBean.
In the originating JSP you create the JavaBean with <jsp:useBean>, scope
set to "request", and set its properties with <jsp:setProperty>. In the
target JSP you do the reverse; declare a name for the JavaBean with
<jsp:useBean>, again with scope="request", and get the properties with
<jsp:getProperty>, or process them with a scriptlet, or use them as
input values in a new <jsp:setProperty>.
In JSP 1.1 you may be able to just add simple string parameters to the
URL is <jsp:forward> using the regular "?par=value" syntax (it's in the
Servlet 2.2 draft).
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".