Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tomcat 6 no parsing request parameters with &  RSS feed

 
Harry Brearley
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, this must be simple but it is killing me....
i need to make tomcat parse the following url
http://ctkdevas1.explab.mobi:8080/ctk/test.jsp?q=hello&r=goodbye
try the link - it returns "r=null"
when i send in the following link -
http://ctkdevas1.explab.mobi:8080/ctk/test.jsp?q=hello&r=goodbye
it returns "r=goodbye"
i need to use UrlEncoding Why is this not working
The test.jsp is as below
 
Harry Brearley
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please note - the URL's look the same but the one that does not work uses the urlEncoding for & e.g.

please try for yourselves
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you click on them in here, they don't just look the same.
They are the same.

UBB actually creates a link with the parsed version.


You shouldn't URL encode the whole querystring.
You should URL encode the parts of the querystring and then paste them together with the control characters (& and ?) as your separators.

If you url encode the whole string, the encoder will escape the control character which stops them from being control characters.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!