This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes Data of previous form gets submitted on refersh Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Data of previous form gets submitted on refersh " Watch "Data of previous form gets submitted on refersh " New topic
Author

Data of previous form gets submitted on refersh

Amolk Patil
Greenhorn

Joined: Feb 08, 2011
Posts: 5
Hello ,
I am developing a web based application using jsp and servlet. In this application I have login page, validation servlet if user is valid user I called the another servlet which retrieves the form names from database and this data is send to jsp page where use has to select form. On the submit event of this jsp page again I call one servlet which retrieves form data from database. And send data to next jsp page on this jsp page user has to fill the form and on submit action i have called servlet to update data into database. And after successful submission of data I have redirected the response to previous servlet which retrieves next form data from database. But if here I press refresh button the previous form data gets submitted into database with new form.

Can any one please help me to solve this problem?
I have use the no cache control in all my jsps and servlets.

Thanks in advance

Regards,
Amol
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56205
    
  13

Are you sure that the last action is a redirect? it sounds like you are leaving the POST as the last action.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Amolk Patil
Greenhorn

Joined: Feb 08, 2011
Posts: 5
Thanks for response Bear Bibeault.

I used RequestDispatcher to go back to previous servlet.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Data of previous form gets submitted on refersh
 
Similar Threads
Intermediate loading page
Embed form element value in scriplet?
When to use beans or servlets
encodeURL() purpose and best place to use
JSP and JavaScript