Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Problem with persisting text box values in JSP

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi fellow ranchers

I have a JSP with a from in it, containing a set of check boxes and text boxes. Each text box is enabled only when it's respective check box is selected.
Now after entering requisite values, the user hits the submit button on the page and is redirected to other page.

The problem is that when the user clicks the 'browsers' back button from the second page, the first page gets loaded with the text boxes holding the values which were previously entered. As I am not storing the values of the text boxes in session, I don't expect to see the text boxes already populated.


I am begining to think that this has got to do something with the browser. Any help to sort this out would be greatly appreciated.( I sincerely don't want to disable the back button of the browser)
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

VineetK Singh wrote:
The problem is that when the user clicks the 'browsers' back button from the second page, the first page gets loaded with the text boxes holding the values which were previously entered.


it is obvious behavior of browser . thats why back button is there. still i dont understand your problem
 
VineetK Singh
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please go throught the attachment. When I click on the calculate button on this form, a new jsp opens with some results. Now when that jsp is loaded into the browser and the browser's back button is clicked the previous page is opened(my original page, shown in attachment). Everything is fine till here, but now the text boxes contain the values which were entered by the user before hitting the calculate button.


Hope you were able to understand my problem.
form.JPG
[Thumbnail for form.JPG]
Form image
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

VineetK Singh wrote: but now the text boxes contain the values which were entered by the user before hitting the calculate button.



Yes i already mentioned ,the browser will show that value . if you dont want then prevent browser cache
 
VineetK Singh
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks seetharaman for helping out. I've got the solution.


For anyone who stubles by this post, you've to add this line in your jsp
 
reply
    Bookmark Topic Watch Topic
  • New Topic