aspose file tools*
The moose likes JSP and the fly likes & in url parameter value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "& in url parameter value" Watch "& in url parameter value" New topic
Author

& in url parameter value

George Liao
Greenhorn

Joined: May 20, 2003
Posts: 14
I have a java program to generate the URL in the jsp. The URL format is like www.mydomain.com/?para1=value1¶2=value2. The value2 is like "home & address". When I use request.getParameter(�para2�), the return value is home, not home & address. In order to get "home & address",is anything I should do when I generate the URL? Thanks in advance.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Yes, you should URL Encode the names and values in the querystring so that they are not confused with control characters.

If you're building the querystring with Java on the server side, look at java.net.URLEncoder.
[ June 05, 2008: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
George Liao
Greenhorn

Joined: May 20, 2003
Posts: 14
Thanks Ben.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: & in url parameter value