Hi,
I found sessionForm flag in AbstractFormController. In documentation it is described as follows: "This allows you e.g. to retrieve an object from the database, let the user edit it, and then persist it again". This is common scenario and i had found it useful in my previous projects using struts. Now i'm trying the same thing with sessionForm. I've two controllers - one controller simple (A) retrieves bean from service layer and puts it in session (and shows view) allowing users to submit form into second controller (B). Since i've marked B controller with sessionForm it gets Command object from session instead of calling formBackingObject(). Everything works just fine - but I found it very inconvinient to hardcode very long session attribute name into A controller. Since B controller by default searches sesion using getFormSessionAttributeName() which uses class name plus command name to find a command instance in session. I cannot override getFormSessionAttributeName() in B controller since it's final. I wonder if there is a simple way to guess session attribute name in A controller or force b controller to find Command objects under simpler name. Or maybe this is an antipattern?
Artur


Reply With Quote