Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

special Characters #, + etc. in popup window  RSS feed

 
Swapna Omprakash
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am appending string values to the action and calling a popup from a jsp.
url = 'ColPreviewAction.do?'+strValues;

In my action class I call
queryStr = URLDecoder.decode(request.getQueryString(), "UTF-8");

If there are special characters in the query string, I am not getting any characters after the special character in my query string.

ex: if strValues = sk#sbc
when I decode I am getting only upto sk in the query string.

Could anyone please tell me how to handle special characters like # using popup window.

Thanks,
Swapna.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at URLEncoder

Just make sure not to encode the actual control characters that define your querystring.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you trying to decode the query string yourself in the first place?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!