File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Submitting forms with URL re-writing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Submitting forms with URL re-writing" Watch "Submitting forms with URL re-writing" New topic
Author

Submitting forms with URL re-writing

Hazel Sisson
Greenhorn

Joined: Feb 12, 2002
Posts: 17
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

Joined: May 10, 2001
Posts: 3244
Hazel
It is the 'action' attribute of the form tag that needs to be encoded.


Dave
Hazel Sisson
Greenhorn

Joined: Feb 12, 2002
Posts: 17
Thanks Dave.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Submitting forms with URL re-writing
 
Similar Threads
proxy timeout causing problems in servlet [serious]
Proper way to exit a servlet, and release the resources it is using?
Redirecting to a page
Redirecting to an URL from servlet
Redirecting to a page