• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem fetching request parameter  RSS feed

 
Debashish Chakrabarty
Ranch Hand
Posts: 231
Firefox Browser Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
One of my JSPs is being passed a query string the value of which is hashed. I need to pass this value to bean "as it is". (I show only the problematic query string here, there are are parameters I pass as well)

Problem is, when I do a request.getparameter("HashVal") I get some very different characters like "└m╧T�╞┘�Q]↕∩&?�┐?N�". Obviously my bean does not gets the value it needs. Interestingly on doing a request.getQueryString() the whole string is reproduced nicely. But since there are many parameters I would probably have to manipulate this string which I don't want to do.
How can I retrieve the exact query-string value?
[ May 22, 2003: Message edited by: Debashish Chakrabarty ]
 
Debashish Chakrabarty
Ranch Hand
Posts: 231
Firefox Browser Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An Update:
It seems a getParameter() call is decoding the value of "HashVal". When I tried encoding it again using URLEncoder.encode (using character encoding ISO-8859-1) the string macthed the original query string.
Further thoughts:
My JSP page directive does not define the content-type/charset. So the default must be ISO-8859-1 (?).
How come then the correct value of the query-string HashVal is retrieved only if I use the method
URLEncoder.encode(request.getParameter("HashVal"),"ISO-8859-1"))
and not on using URLEncoder.encode(request.getParameter("HashVal"))?
Any comments Ranchers?
[ May 23, 2003: Message edited by: Debashish Chakrabarty ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!