users@javaserverfaces-spec-public.java.net

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

From: Edward Burns <edward.burns_at_oracle.com>
Date: Mon, 25 Feb 2013 12:37:06 -0800

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

--