Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

& in url parameter value

 
George Liao
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
George Liao
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic