How can I prevent data to be added into my database twice when using a form on a JSP page? On Browser refresh, the same data is added to my database table.

Govind Seshadri

Set a boolean variable with session scope when you successfully add data into the database the first time around. You can then check for the presence of this variable whenever the user performs a refresh - if the variable is true, then simply skip the database insert.