Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

URL encoding/decoding

843842Jul 15 2009 — edited Jul 16 2009
Hi Java people,


I'm implementing a filter with HTTPCLIENT that processes requests from many sources, and I always do a redirection at the end, the problem I have is that some request are encoded with:

java.net.URLEncoder.encode(reqString, "UTF-8");

others not, so in my filter those that are not encoded work properly with:

httpMethod.setURI(new URI(resourcePath.toString(), false));

and those that are encoded work properly with:

httpMethod.setURI(new URI(resourcePath.toString(), true));

How can I know whether or not an incoming request was encoded? or How can I deal with this?

Thanks in advanced!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 13 2009
Added on Jul 15 2009
2 comments
156 views