Tuesday April 20, 2004

How does your MVC framework handle duplicate posts? One of the problems that you'll often see in webapps is that when a record is added - hitting refresh on the browser will cause a 2nd record to be added. This is because the "Save" action usually does a forward, rather than a redirect, and the full post is re-created. I'm curious to know how other MVC Frameworks handle this issue, particularly Spring, WebWork, Tapestry and JSF. In Struts, it's pretty simple to solve. When the form is first displayed, you'll likely go through an Action. In AppFuse, this would be something like UserAction.edit(). In the edit method, you add a saveToken() call to put a token into the session:
// edit method - mark start of operation
|
Then in the save() method, you can check for a duplicate post using the isTokenValid() method:
// save method - check for valid token
|
How does your Java MVC framework handle this? Do you have to programmatically handle it like Struts - or is it built-in to the framework to handle it auto-magically?
Posted in Java at Apr 20 2004, 11:36:29 PM MDT 22 CommentsSearch This Site
Recent Entries
- The Cloud Computing Continuum with Bob McWhirter
- Software Quality: The Quest for the Holy Grail?
- What's Happening in the Java World?
- Fantastic Fun in Jackson Hole
- How We Hired a Team of 10 in 2 Months
- Jack's Skiing Like A Madman!
- My Future of Web Frameworks Presentation
- My Guest Room Remodel is finished!
- Web Application Testing with Selenium by Jason Huggins
- Web Application Testing with Selenium at Agile Denver next Monday