Transaction Integrity Problem with MVC

I have develop a web application follows J2EE design pattern like Front Controller and others in J2EE Petstore Example. I'm not using any EJB,only serlvet , JSP and Javabeans and implement Command Pattern in the framework.

It has a entry form and after i submit the form , the controller servlet will request dispatch to the next screen. If i reload the page , it will insert again and cause duplicate data was inserted to database.

According to Manning -WebDevelopment With JavaServerPages Chapter 9 , they have implement CommandToken to control the transaction integrity.

In the J2EE PetStore, how the FlowHandler can handle this problem of page reloading ?

Any suggestion or ideas?

[730 byte] By [cklim] at [2007-9-26 12:07:33]
# 1

You need to instigate some session management, this is the purpose of Session Ejb's but you can also do this manually in the servlet through traditional Http sessions & ordinary Beans. I would expect this to be covered in the any Java Web Development text, including the one you mention. Key word to use are Session and Cookies.

MartinS. at 2007-7-2 2:35:22 > top of Java-index,Other Topics,Patterns & OO Design...