avoid caching in the client

I'm using servlets + jsp technology.

I have a form that inserts a person in the database.

When you post the form the servlet attends the request in the doPost method, calls a DAO object that inserts this data in the database, asigning an id number for this person and giving it back. to the servlet.

Then the servlet sends back a page that informs that the person has been inserted.

At this point (with the result page in the browser), the user click the back button. This shows the form again with all the data the he has completed before. If he click the OK button the form is posted again to the servlet, and a new person is inserted in the database with a new id. But this person is the same.

How can I avoid this?

I don't know if I'm clear enough. Please help

Thanks

[828 byte] By [DesarrolloScreenNamea] at [2007-10-2 9:32:59]
# 1
Maybe this will work for you. http://www.htmlgoodies.com/beyond/reference/article.php/3472881-S
slenzia at 2007-7-16 23:39:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

For even more aggressive "don't cache this page", especially to fight various Microsoft IE versions' caching "features":

public static void disableCaching(HttpServletResponse response)

{

response.addDateHeader("Expires", 791589600000); // Wed Feb 01 00:00:00 EET 1995

response.addHeader("Cache-Control", "no-store,no-cache,must-revalidate,post-check=0,pre-check=0");

response.addHeader("Pragma", "no-cache");

}

For more info: http://www.google.com/search?q=no-cache+pre-check+post-check+pragma

sjasjaa at 2007-7-16 23:39:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...