Tuesday, April 17, 2007

What is the difference in between encodeRedirectURL and encodeURL?

encodeURL is used for all URLs in a servlet's output. It helps session ids to be encoded with the URL. Moreover it rewrites URLs relative to the current document.if the url is not starting with 'http//.' and encodes any parameters added with the request.addQueryParameter or request.addURLParameter methods.

As per Servlet API the encodeRedirectURL must ALWAYS be used within response.sendRedirect() commands.It is used for encoding session ids with URL but only while redirecting.

0 comments :

 

Disclaimer
Interview Questions On Java,Java EE Copyright © 2016. Reads: best tracker