duplicate records

when i am creating a record like inserting a record then if i refresh a page same record get inserted again . I am auto incrementing Emp Id. which is a primary key. but other than that everything else is duplicating.

When you are refreshing a page the http event like "/addemployee.do" (assuming struts flow) is getting fired again as before refreshing the page the url which made employee record insertion before page refresh is still there in browsers address bar.There couldn't be new entry if you were editing existing field , I mean "/editemployee.do" kinda functionality. Whatever happening is quiet natural only instead of you clicking on "submit" button and in turn it resulting into corresponding action(in this case /addemployee.do)browser directly firing this http event. But why do you need to refresh your pade anyway?