Results 1 to 4 of 4

Thread: What are the disadvantages of using sessionForm=false?

  1. #1
    Join Date
    Nov 2008
    Posts
    2

    Default What are the disadvantages of using sessionForm=false?

    Hello!

    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?

    Thank you!

  2. #2
    Join Date
    May 2005
    Posts
    288

    Default

    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. #3
    Join Date
    Nov 2008
    Posts
    2

    Default

    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. #4
    Join Date
    May 2005
    Posts
    288

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •