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

Refreshing jsp page

 
vara prasad
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,


I found a problem in my jsp page. I written a code for registration form. This form takes details from the user. I am taking the these details through bean(storing this bean in the request object). I am validating in the bean and giving the validation errors to the same jsp page.

On succesfull validation i am sending the details to another jsp(<jsp:forward page="x.jsp" /> ), from where i am storing these details in database. these details are stored in database. O.K ....


Now the problem when user comes back to the registration form by using back button on Internet Explorer tool bar and pressing the refresh button the details once again going to the database.

How to avoid that? i don't have to use response.sendRedirect("x.jsp") there.
 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should look into using struts, as it sounds like your design correlates very strongly to how struts handles requests. Struts provides us with saveToken() and isTokenValid() methods. Here's how you can do it with jsp.



BTW, your token is put into the form as a hidden field.

[ August 13, 2005: Message edited by: Kerry Wilson ]
[ August 13, 2005: Message edited by: Kerry Wilson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic