Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with persisting text box values in JSP

 
VineetK Singh
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • 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)
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • 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
  • 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
Form image
[Thumbnail for form.JPG]
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic