Announcement Announcement Module
No announcement yet.
What are the disadvantages of using sessionForm=false? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:

    When I set sessionForm to false it seems to work. Are there any significant disadvantages?

    Thank you!

  • #2
    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.


    • #3
      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?


      • #4
        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.