Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > servlet request handling - escaped characters in request

Reply
Thread Tools

servlet request handling - escaped characters in request

 
 
Thea
Guest
Posts: n/a
 
      09-15-2006
Hello
I have following problem and I'm not sure where to look for solution,
or even if this is correct group for it, so please redirect me if you
know more apropriate group / know good webpage

I have request coming from outside world. As many requests do, one that
I'm recieving has parameters coming with it.
Trouble is that parameters can come in form
bin.id=45&res.h=150&res.w=150
or
bin.id=45&res.h=150&res.w=150
When parameters are given like in first case everything works fine, but
when second type of request comes, request.getParameterNames(),
request.getParameter(...) and all functions that deal with parameters
simply do not see them.
I guess that's because of those escaped ampersand signs, but have
absolutely no idea how to solve this problem... Is there maybe any way
to get around it?
I cannot avoid getting requests with escaped ampersands and they must
be processed properly, I can't simply send error response.

I really have no idea where to start searching...
Thanks for help.
~Thea

 
Reply With Quote
 
 
 
 
steepyirl
Guest
Posts: n/a
 
      09-15-2006
Try java.net.URLDecoder.decode(), *before* you append the params to the
request URI.

Thea wrote:
> Hello
> I have following problem and I'm not sure where to look for solution,
> or even if this is correct group for it, so please redirect me if you
> know more apropriate group / know good webpage
>
> I have request coming from outside world. As many requests do, one that
> I'm recieving has parameters coming with it.
> Trouble is that parameters can come in form
> bin.id=45&res.h=150&res.w=150
> or
> bin.id=45&res.h=150&res.w=150
> When parameters are given like in first case everything works fine, but
> when second type of request comes, request.getParameterNames(),
> request.getParameter(...) and all functions that deal with parameters
> simply do not see them.
> I guess that's because of those escaped ampersand signs, but have
> absolutely no idea how to solve this problem... Is there maybe any way
> to get around it?
> I cannot avoid getting requests with escaped ampersands and they must
> be processed properly, I can't simply send error response.
>
> I really have no idea where to start searching...
> Thanks for help.
> ~Thea


 
Reply With Quote
 
 
 
 
Thea
Guest
Posts: n/a
 
      09-22-2006
Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Raw Text Escaped Characters to Characters nicholas.wakefield@gmail.com Java 2 07-11-2005 09:17 PM
Minidom output of XML escaped characters Derek Basch Python 2 03-25-2005 05:25 PM
Translating escaped characters Henrik S. Hansen Python 2 11-02-2004 07:12 AM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM
Translate escaped characters in a string Ben Finney Python 2 04-03-2004 07:46 AM



Advertisments