aspose file tools*
The moose likes JSP and the fly likes Problem with persisting text box values in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem with persisting text box values in JSP" Watch "Problem with persisting text box values in JSP" New topic
Author

Problem with persisting text box values in JSP

VineetK Singh
Ranch Hand

Joined: Jun 02, 2009
Posts: 47
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)


Copy Paste is a design error!!
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Jun 02, 2009
Posts: 47
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.



[Thumbnail for form.JPG]

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Jun 02, 2009
Posts: 47
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with persisting text box values in JSP