This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Servlets and the fly likes Difference between encodeURL and encodeRedirectURL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Difference between encodeURL and encodeRedirectURL" Watch "Difference between encodeURL and encodeRedirectURL" New topic
Author

Difference between encodeURL and encodeRedirectURL

Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Hi All,
I want to know the difference between the encodeURL and encodeRedirectURL. I have found some related topics in the Java ranch, but i am not able to pinpoint the reason. Can anyone help me?
Thanks & Regards,
M.S.Raman
Arun Boraiah
Ranch Hand

Joined: Nov 28, 2001
Posts: 233
When redirecting to a page using sendRedirect use encodeRedirectURL, that is you are passing yoursession to the new request.
encodeURL can be used while include or forward to a page, where you need to pass the session info.
JSESSIONID gets appended in the url when cookies are disabled.


Sharing is learning
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Originally posted by Arun Boraiah:
When redirecting to a page using sendRedirect use encodeRedirectURL, that is you are passing yoursession to the new request.
encodeURL can be used while include or forward to a page, where you need to pass the session info.
JSESSIONID gets appended in the url when cookies are disabled.

Thanks for your prompt reply. I need some clarification.
If we are redirecting the request to some other page, why we need to pass the session information to that page?
Regards,
M.S.Raman
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between encodeURL and encodeRedirectURL