AF
HomeTagSubmit NotesAsk AnythingLoginSubscribe Us
AF
1. Feel Free to ask and submit anything on Anyforum.in and get satisfactory answer
2. Registration is not compulsory, you can directly login via google or facebook
3. Our Experts are looking for yours ?.



java-servlet: What is the difference between encodeRedirectUrl and encodeURL?

Please explain the difference between encodeRedirectUrl and encodeURL.

java x 211
servlet x 20
Posted On : 2014-06-07 00:44:19.0
profile Garima Gupta - anyforum.in Garima Gupta
596129560202
up-rate
4
down-rate

Answers


HttpServletResponse provides method to encode URL in HTML hyperlinks so that the special characters and white spaces can be escaped and append session id to the URL. It behaves similar to URLEncoder encode method with additional process to append jsessionid parameter at the end of the URL.

However HttpServletResponse encodeRedirectUrl() method is used specially for encode the redirect URL in response.

So when we are providing URL rewriting support, for hyperlinks in HTML response, we should use encodeURL() method whereas for redirect URL we should use encodeRedirectUrl() method.

Posted On : 2014-06-07 00:59:15
Satisfied : 1 Yes  0 No
profile Rishi Kumar - anyforum.in Rishi Kumar
523188250045
Reply This Thread
up-rate
5
down-rate



Post Answer
Please Login First to Post Answer: Login login with facebook - anyforum.in