tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <>
Subject Re: jsp:forward adds params to query-string
Date Wed, 08 Jul 2009 02:05:01 GMT

"Yves Glodt" <> wrote in message
> Hi,
> I have a simple jsp-page whose only purpose is to jsp:forward to my
> main controller-servlet, here it is:
> <%@ page session="true" %>
> <%@ page language="java" contentType="text/html; charset=UTF-8"
> pageEncoding="UTF-8"%>
> <jsp:forward page="/FormProcessor">
> <jsp:param name="o" value="action1" />
> </jsp:forward>
> The problem I have is that the request comes as POST to the servlet,
> but without the "o"-parameter.
> The o-param instead comes as query-string o=action1

Yes, this is what is specified in the Servlet spec.  A <jsp:param> adds the 
parameter to the query-string.

> Note that the post-request comes from an external URL.
> Does jsp:foward not preserve the original request? I would like to keep 
> all POST

The POST parameters will still be available.  What the Servlet will see 
(using request.getParameter(String) and friends) is the union of the 
query-string parameters and the POST parameters.

Of course, u could have found this out faster by testing it yourself ;).

> Best regards,
> Yves 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message