This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes How to force URL Rewriting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to force URL Rewriting" Watch "How to force URL Rewriting" New topic
Author

How to force URL Rewriting

amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 511
Hi,
I have a scenario wherein I want to force the encoding of a URL so that response.encodeURL() appends the sessionid to it.
At the moment this API is not appending the sessionid which I guess is because session is being tracked by cookies , in which case the API method does not necessarily appends the sessionid.
Is there anyway I can force this to happen?

regds
Amit


Regards,
Amit
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

That's not "encoding", that's "rewriting". I suggest you change your subject accordingly.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Abhishek Asthana
Ranch Hand

Joined: Sep 08, 2004
Posts: 146
You are right. response.encodeURL() will append sessionID only if cookies are disabled.
But why do you need to append the sessionID to URL, when you can always pick it up from the session.

Thanks
Abhishek
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 511
Hi,
Bear:
Thanks for pointing out the mistake.

Abhishek:
I want to force the URL rewriting even if cookies are enabled. There is one scenario we have where sessionid as part of URL is needed.

Regds
Amit
 
Don't get me started about those stupid light bulbs.
 
subject: How to force URL Rewriting
 
Similar Threads
session tracking
iframe session problem
JRun does not sendRedirect() properly
How can I not Append JRUNSESSIONID ="jkhjhjkjhjkhjkhj" to the URL
jsp session traking