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]
# 1
The chances that cookies are blocked is very slim. Even if they're blocked, one can test if the cookies are enabled and if not one can redirect a person to the appropriate page with instructions to enable the cookie.
appy77a at 2007-7-9 5:36:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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"?

evnafetsa at 2007-7-9 5:36:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Thanks for your supporti got it
faisalloea at 2007-7-9 5:36:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...