On 7/14/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
> 
> You mean, to have analog of _viewstate in ASP.NET? I know that JSF
> supports it too, but in JSF state is saved on server by default, which
> is a relief. JSF backing beans have "session" scope by default, no
> hidden fields are used. Thus, you are free to leave the application,
> browse somewhere else, and then return back. And separation between
> input and output is a snap, just add <redirect> element in the
> navigation rule, and voila! The view will be loaded with a separate
> GET request, and will be rendered using data, stored on the server. I
> would switch to JSF only for that.
> 

Just one minor clarification ... while the default for component state
saving is indeed server side, there is no default for backing beans
... you must explicitly declare the <managed-bean-scope> you want to
use for each such bean.

And a note on an option that JSF provides ... JSF components have, in
addition to the typical JavaBeans properties, a Map property called
"attributes" that can be used to store arbitrary data.  It's quite
common for components (or applications) to store state information on
some component in the hierarchy (often the form component, or perhaps
the view root) and let JSF take care of saving and restoring it.  That
way, you can keep your backing beans themselves in request scope
without losing anything, because they only contain state within the
context of the current request.

The only restriction to this is that the state info you stash has to
be Serializable.

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to