Response Redirect related Queries!
hello guys,
i posted article before wid same question but i could not found again i wonder.
well asking again the same question
respose.sendRedirect (its client side redirection and i think session breaks)
RequestDispatcher (its server side rediretion and session does not breaks)
we use methods below if we want to send session info in URL instead of incase if cookies are blocked
how to use these two methods ?
encodeRedirectURL (param passed should be like response.encodeRedirectURL( response.encodeURL() )
encodeURL
thanks in advance for your Advice
Thanks
Faisal khan
[646 byte] By [
faisalloea] at [2007-11-26 18:05:46]

# 2
"encoding" the url basically means that the session id will be appended to the URL if the server thinks it necessary (ie the browser accepts session cookies or not)
If you are using the URL in a call to sendRedirect, then you use response.encodeRedirectURL, otherwise just encodeURL
encodeURL is used with any url being generated onto the page.
eg <a href="<%= response.encodeURL("/anotherPage.jsp") %>"
If you are using the requestDispatcher there is no need to encode the URL. The transfer is purely internal, and doesn't go back to the client.
What are you meaning by "session breaks"?