Hi!

Peter Guyatt wrote:

I have a problem where a user enters data into a form and then submits this
to the server, which in turn wrights this content into a database.

The problem I have is that if the user then refreshes the page via F5 then
it adds the same data in again.

Is there any way to ensure that this does not occur.

Not really... to your servlet/jsp processing the HTTP-POST, those two requests are two separate entities that each need to be processed. How should your servlet know if the second request is a reload or another person POSTing from the same machine as the first one?
If you have any criteria in the data itself, you could, of course, add some kind of logic to the servlet in order to validate the data first. If, for example, you d not want two database rows that are entirely identical, you could first SELECT the form data and only INSERT if there is no result.


HTH

Phil


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to