Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Submitting forms with URL re-writing

 
Hazel Sisson
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
I am currently building a web application using JSP and servlets, and have successfully implemented session tracking using the HttpSession. I am also using encodeUrl() on each link in case the user has disabled cookies. It works fine until there is a form and the user hits submit, then the session is lost and they are taken back to the login page.
The submit button just uses this javascript ocument.bookDetails.submit() to submit the data, then the form calls a servlet which processes the form data, updates the DB and then calls a new page using requestDispatcher.
Obviously this needs to be changed, but I have no idea what it should be changed to! Is it the servlet that needs to be changed? What do I need to do to maintain the URL re-writing?
Thanks very much,
Hazel
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hazel
It is the 'action' attribute of the form tag that needs to be encoded.
 
Hazel Sisson
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dave.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic