Feb 23rd, 2010, 03:15 AM
What are the disadvantages of using sessionForm=false?
Until now I used the setting sessionForm=true in my Spring MVC forms. I ran into some (well known) problems with opening the same form in two or more tabs. A possible solution for this problem is described here: http://learn2program.wordpress.com/2...of-spring-mvc/
When I set sessionForm to false it seems to work. Are there any significant disadvantages?
Feb 23rd, 2010, 04:16 AM
Maybe not significant, but if you have attributes in your command object, which are not part of the form, you need to have a hidden field for them. The usual suspect would be the date of the last update for optimistic locking.
Feb 23rd, 2010, 04:36 AM
I thought if I update an object and not all fields of this object are part of the form, formBackingObject() is called at submit, the object is loaded from the database and the fields are set, too. Did I get something wrong here?
Feb 23rd, 2010, 08:11 AM
You are right about formBackingObject() being called. But if you want to lock optimisticly , you still have to put a hidden field into the form. Otherwise you wouldn't be able to detect an update between displaying and submitting the form.
Besides, you have a hit to the database for every request.
Tags for this Thread