aspose file tools*
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 Spring in Action this week in the Spring 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: 514
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: 61413
    
  67

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: 514
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to force URL Rewriting