servlet request handling - escaped characters in request

T

Thea

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
 
S

steepyirl

Try java.net.URLDecoder.decode(), *before* you append the params to the
request URI.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top