• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Submitting forms with URL re-writing

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Dave.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic