Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Incoming Parameter Value Encoding Problem

 
steve nacosta
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i am receiving some request from other servlet,

url in the browser shows,
http://localhost:8080/....../DemoServlet?sign=q4ZuW4ubPu2axXcAj9kHy%2B3cKHIxXfStgyFTw5/cNKlr5%2B%2B%2BK/LI68QxDYqOVHUoV&exp=05/2015&.....


i want the 'sign' parameter value in my servlet as its shown in url which is,
"q4ZuW4ubPu2axXcAj9kHy%2B3cKHIxXfStgyFTw5/cNKlr5%2B%2B%2BK/LI68QxDYqOVHUoV"


now in my servlet DemoServlet, i am trying to get the 'sign' parameter value,
String sign=URLEncoder.encode(request.getParameter("sign"),"UTF-8");

which actually assign sign="q4ZuW4ubPu2axXcAj9kHy%2B3cKHIxXfStgyFTw5%2FcNKlr5%2B%2B%2BK%2FLI68QxDYqOVHUoV"

that is the value that i don't want,
the difference in url and string is all the '/' are in form of hexa value '%2F',

how can i get the correct value,
please suggest.


-Thanks

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't want the encoded value, why are you encoding it?
 
steve nacosta
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:If you don't want the encoded value, why are you encoding it?


thanks for your reply.

actually without encoding i am getting the string that is even worst...

never the less,i managed to make some function which convert %2F --> '/' .





 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You shouldn't have to do any conversions. You should be fixing the real problem rather than applying a band aid.
 
steve nacosta
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok i'll do it.

Thanks...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic