|
From: Ken K. <kk...@kk...> - 2003-05-20 14:41:45
|
Juergen, There is a problem in my version 1 prototype of the petclinic demo. Should a user change an owner's info and then use the Back button and try and resubmit the form (which has sessionForm==true) to make another change, the method AbstractFormController.handleRequestInternal will call userObject to retrieve the form object from the session. Since the form object is no longer there, this results in a ServletException. My current working version works around this by overriding isFormSubmission which only returns true if the method was POST and it can find the form object. Since I have also overriden formBackingObject to provide the owner info in the first place, this results in a redisplay of the form with the user's latest changes silently ignored. This process must seem unreasonable to users who know nothing about the problems enterprise application developers face with the browser's Back button. Maybe I'm going about this wrong. This also brings up the issue of when a developer specifically wants to forbid resubmission as in a purchase transaction. Struts provides support for a synchronizing token to prevent duplicate submissions using the <html:form> tag. Perhaps we should provide some infrastructure to help developers solve these problems in a consistent way. I am also a little bit concerned over the process used in AbstractFormController and SimpleFormController. Developers may see this as too restrictive, especially if they are used to the flexible forwarding strategy of Struts. What are your thoughts on this ? Ken |