tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steffen Heil" <>
Subject AW: Multiple arguments in a GET URL
Date Sat, 02 Oct 2004 05:57:05 GMT

> I am attempting to redirect to a URL that is similar to the following
> However, I can only do a request.getParameter on item1 in the somePage.jsp
JSP.  When I attempt to do it for item2, it fails..

This is correct behavior.
Tomcat splits the url (at ?) as follows:

Called page:
Parameters: mainFrame=somePage.jsp?item1=info1&item2=info2

Then the parameters are split (at &):

Parameter1: mainFrame=somePage.jsp?item1=info1
Parameter2: item2=info2

So mainFrame is a paramter to index.jsp, but item2 is ALSO.

You want only one Parameter. So you need to urlEncode that one:
Called page:
Parameters: mainFrame=somePage.jsp?item1=info1&26item2=info2

You just jeed to replace & with &26. Propably it would be best to replace
the ? as well, but I just don't have it's ascii code in mind.

You complete URL would be:
No code change needed.


View raw message