users@javaserverfaces-spec-public.java.net

[jsr344-experts mirror] [jsr344-experts] Re: [1055-StatelessJSF] PROPOSAL

From: Frank Caputo <frank_at_frankcaputo.de>
Date: Tue, 26 Feb 2013 18:37:20 +0100

Hi Ed,

+1 for JSF going stateless.

I have only one question: Can we handle post backs in stateless mode?

We should make this possible, if the developer provides an id for all form elements, so that the view can be correctly restored using the information in the request with a dummy view state form parameter. I've implemented something like this some weeks ago with a few lines of code.

Ciao Frank

Am 25.02.2013 um 21:37 schrieb Edward Burns <edward.burns_at_oracle.com>:

> Hello Volunteers,
>
> You may have seen Manfred Riem's blog entry about stateless JSF. [1] I
> wonder what you think about adding this for 2.2? Here are the spec
> changes we would need for this minimal, yet effective approach.
>
> * Expose existing transient attribute on UIComponent on VDLDoc for
> <f:view>.
>
> The text of the attribute will be based on UIComponent.isTransient():
>
> If true, the component (and therefore the children of the component)
> must not participate in state saving or restoring.
>
> * In section 7.7.2.8 ViewDeclarationLanguage.restoreView(), change the
> text to be the following.
>
> The JSP implementation must:
>
> [include the existing text of the section.]
>
> The Facelet implementation must:
>
> Call ResponseStateManager.isStateless(). If true, take the
> following action (I will put this in English rather than code).
>
> ViewDeclarationLanguage vdl = vdlFactory.getViewDeclarationLanguage(viewId);
> viewRoot = vdl.createView(context, viewId);
> @@ -543,9 +547,9 @@
> ViewDeclarationLanguage vdl = vdlFactory.getViewDeclarationLanguage(viewId);
> viewRoot = vdl.getViewMetadata(context, viewId).createMetadataView(context);
> context.setViewRoot(viewRoot);
>
> and return, otherwise [...include existing text of the section].
>
> * In ResponseStateManager.writeState(), if the UIViewRoot is transient,
> take impl specific action to make it so the call to
> ResponseStateManager.isStateless() during the the next call, from
> ViewDeclarationLanguage.restoreView(), returns true.
>
> * Spec for new method ResponseStateManager.isStateless(). If the
> preceding writeState() was stateless, return true. If the preceding
> writeState() was statefull return false, otherwise throw
> IllegalStateException.
>
> Thanks,
>
> Ed
>
>
> [1] http://weblogs.java.net/blog/mriem/archive/2013/02/08/jsf-going-stateless
>
> --
>




-

Frank Caputo
Johann-Mohr-Weg 24d
22763 Hamburg

Mobil +49 177 61 61 81 3
E-Mail info_at_frankcaputo.de