Ray Clough wrote:
I'm obviously missing something. Am I understanding this scenario
correctly:
I have 2 methods in my Action class: 'init' and 'save'. The 'init' method
instantiates an instance variable 'myList', which is available to the jsp
page thru a 'getList' method. The page is loaded and the 'myList'
properties are displayed and edited. The user presses the 'save' button,
and a new instance of the Action is class is created, so there is no longer
a reference to the edited 'myList' object.
Correct. Actions are instantiated per-request, so if you need that
object to be available in the save() method, you'll need to
fetch/construct it again.
If I were to implement 'ModelDriven' to push the 'myList' onto the stack,
would this object persist through the Request/Response cycle. Would there
be any benefit to that over storing it in the session?
No, it wouldn't. The OGNL value stack is built per-request too. You will
either have to put the list into the session or, as noted above,
re-fetch or re-build it during request processing for the save() method.
L.
Thanks,
Ray Clough
Dave Newton-4 wrote:
--- Ray Clough <[EMAIL PROTECTED]> wrote:
Is the creation of a new instance the standard
behavior - I can't believe it is, because that would
make the whole 'thread-safe' model in S2 pointless.
That's *why* it's thread-safe.
d.
____________________________________________________________________________________
No need to miss a message. Get email on-the-go
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]