• Post Reply Bookmark Topic Watch Topic
  • New Topic

URL rewriting with HTML special characters (eg &) - Help please!  RSS feed

 
Eilidh
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to pass strings which may contain characters such as & and ? from one JSP to another, and am having problems with them interfering with URL rewriting, as they are already used as delimiters:
<a href="page_name.jsp?param1=value1¶m2=value2">
Using HTML codes doesn't help as the ampersand '&' is converted to '&'. Can anyone help?
thanks,
Eilidh

[This message has been edited by Eilidh McGarry (edited May 02, 2001).]
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use java.net.URLEncoder/java.net.URLDecoder.
- Peter
 
Eilidh
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, this is exactly what I needed!
eilidh
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!