Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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
 
Paper jam tastes about as you would expect. Try some on this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic