• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maintaining Session using Rewriting URL

 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
With the cookies disabled we have no optin other than rely on URL rewriting. but the problem is if i am requesting for a resource from a html Form, how can i maintain the session.

Will i need to rewriting the action say encodeURL(/action/sample.do); and place it as the action attribute for the form tag.

Help me out.
 
Daniel Dalton
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple answer - yes, you'll need to encode the URL, because if you don't you'll lose track of the session.

I'm not sure in what form you're producing the html form - i.e. whether from a servlet or a jsp. If you're generating from a servlet, then yes encodeUrl would be appropriate. If on the other hand you're using a jsp, you could use the url tag from the core library which takes care of URL rewriting automatically:



then write out the url on the action with:


[ August 03, 2006: Message edited by: Daniel Dalton ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic