-
1. Re: An excruciatingly simple SEAM question
baz May 10, 2006 2:57 AM (in response to scottd72)As far as i know your attempt works right.
@Out outjects to the context from which the value was injected, or in case of no injection to the surrounding context.
When you click the register button, you are in a temporary conversation.
When you outject a value it will go to this temporary conversation.
After executing the register action, the temporary conversation gets deleted (and with it your value for debug)
when rendering the registered page, a new temporary conversation is created (with no debug value).
What changes could you make?
1. indroduce long running conversations (Set RegisterAction to CONVERSATION Scope and mark register with @Begin)
2. Create a sessionscoped bean which holds your debug value. Inject and outject debug value
Ciao,
Carsten -
2. Re: An excruciatingly simple SEAM question
gavin.king May 10, 2006 10:50 AM (in response to scottd72)(1) The registration example uses a .
(2) The default scope for @Out is EVENT
(3) Of course any event-scoped state does not carry across a redirect
(4) Conversation-scope state does _always_ carry across a redirect (even for temp conversations)
So just use @Out(scope=ScopeType.CONVERSATION) instead -
3. Re: An excruciatingly simple SEAM question
scottd72 May 11, 2006 7:29 PM (in response to scottd72)Actually, no, CONVERSATION doesn't work. I've finally gotten a combination to work, but:
(1) I need to use "#{debug}", not "#{register.debug}". (Fair enough.)
(2) I need to use a SESSION scope. If I use CONVERSATION instead,
then "#{debug}" gets expanded to the empty string instead of the value assigned in register().
Another unfortunate behavior that confused the heck out of me while I was trying to debug this issue: if I make debug a required output, then if any of the validators fail (because, say, I was only typing in a single-character password), then instead of getting the user-friendly "password must have more characters" warning, the server returns an gnarly error message generated because the debug output wasn't set...the ultimate source of the problem (not enough chars in password) is completely obscured. What's the right way to prevent that from happening, other than just never generating required outputs in any routine that has validated inputs (which sounds like it'd be pretty crippling)?