Dave Newton wrote:
That depends on what happens in your getModel() call... if it doesn't matter
that it's called twice then there aren't any issues.
One of my getModel() methods is sensitive to multiple calls so my
solution was to code around the bug:
private boolean isFirstGetModelCall = true;
public SignUpFormBean getModel() {
if(isFirstGetModelCall) {
isFirstGetModelCall = false;
return new SignUpFormBean(); // not used (but must be non-null)
} else {
// the 2nd call is where we really do the work
return getModelForReal();
}
}
private SignUpFormBean getModelForReal() {
SignUpFormBean signUpFormBean = null;
if(session.get(SignUpFormBean.SESSION_KEY) == null) {
// do nothing
} else {
signUpFormBean = (SignUpFormBean)
session.get(SignUpFormBean.SESSION_KEY);
session.remove(SignUpFormBean.SESSION_KEY);
}
return signUpFormBean;
}
--
Note: the above implements the "form showing" side of a by-hand flash
scope. I found this code was actually clearer by avoiding the Scope
plug-in. Certainly not recommending avoiding the scope plug-in in all
cases, though.
- Gary
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]