tomcat-users mailing list archives

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

"Yves Glodt" <yglodt@gmail.com> wrote in message 
news:abd6c6120907070628v26c8b1d3jbd7e31708e30df1f@mail.gmail.com...
> 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message