This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

JavaRanch » Java Forums » Java » JSP
Bookmark "& in url parameter value" Watch "& in url parameter value" New topic

& in url parameter value

George Liao

Joined: May 20, 2003
Posts: 14
I have a java program to generate the URL in the jsp. The URL format is like¶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

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
[ 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

Joined: May 20, 2003
Posts: 14
Thanks Ben.
Have you checked out Aspose?
subject: & in url parameter value
It's not a secret anymore!