aspose file tools*
The moose likes JSP and the fly likes Refreshing jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Refreshing jsp page" Watch "Refreshing jsp page" New topic
Author

Refreshing jsp page

vara prasad
Ranch Hand

Joined: Dec 21, 2004
Posts: 47
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

Joined: Oct 29, 2003
Posts: 254
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 ]

http://www.goodercode.com
SCJP 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Refreshing jsp page
 
Similar Threads
losing arraylist from request when form submits
Any possible of doing 2 actions in single button using struts
Browser Refresh
Avoiding database insert/update on click of refresh button
remitting values