Friday, November 17, 2006
Alternative Method of Passing Along Model Objects
Rather than calling
setResponsePage(PreviewBeforeSubmit.class), it is also possible to say
setResponsePage(new PreviewBeforeSubmit(modelObject)), then define a constructor in the
PreviewBeforeSubmitclass that takes the model object. This does mean that to go back your originating page must also define a similar constructor, and its no-arg constructor may need to do the original instantiation (or your
This strategy saves a few bytes in your session, since the model object is already in there. It means you won't need a second class in the session to contain the first.
Subscribe to Posts [Atom]