Search code examples
sessionstrutsstruts-1

Disadvantages to define a form bean with session scope in struts 1.x


What are the major disadvantages in using a form bean with session scope in struts 1.x?


Solution

  • You need to implement reset() if your form contains attributes populated from checkboxes. You don't need that to request-scoped form beans.

    You need to reset the form to its default values if you show a creation form for the second time, else the creation form will redisplay the data coming from the last created/updated object.

    You can't have two browser tabs or frames using the same form, because they will walk on each other's toes.

    Form beans should be in the request scope by default.