Andrew Hill wrote:
In my case having multiple windows open for different records using the same mapping and with session scoped action forms was a requirement.
What I do is to have an object called the OperationContext that is stored in the session. Conceptually its like a mini-session. This object has getAttribute() and setAttribute() methods and a few other goodies. Each opCon has a unique id - which has to be included included as part of a url for a request associated with that operation.
I store my action forms in the opCon rather than directly in the session (and have overridden RequestProcessor so it is smart enough to look there).
This stops my forms colliding when I have multiple windows. It also lets me do some other neat things - for example by allowing the opCons to be 'stacked' I can preserve the state of a users interaction with a form while they go off to edit a related record, and then bring them back to that form afterwards in the same state they left it.
Im not using tokens, but if I was (and I very likely will be - when I get around to it) Id override the struts handling to support opCons for them so instead of one token per session, it would be one per opCon.
-----Original Message----- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, 6 August 2003 18:41 To: Struts Users Mailing List Subject: Re: transaction tokens
I was thinking there might be a way of controlling transactions by saving all tokens in the session once they are used, and then if it crops up again, not allowing the execution.
Would be simple to implement with a hashmap I think.
What's the likelihood of 2 transaction tokens being identical, over the course of a user session?
(Theoretically you could apply the same principle to action forms,saving them against a transaction token and then sorting it out in a base class during form.reset() (exceptionally seat-of-pants thinking))
Andrew Hill wrote:
oops, yep. Should have specified that. Only for a session mapped
actionform
will there be a problem. The request ones are of course not affected by
the
problem.
-----Original Message----- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, 6 August 2003 17:56 To: Struts Users Mailing List Subject: Re: transaction tokens
Andrew Hill wrote:
I dont believe so. :-(
<btw> Likewise for multiple actionforms (for the same mapping) when you have >1 windows open (such as you might want for editing several records selected
from a list in the main window...)
</btw>
what's the problem with that? You mean you have the action form in the session?
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]