jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Re: [1056-flexibleStateSaving] thoughts about state saving

From: Arjan Tijms <arjan.tijms_at_zeef.com>
Date: Wed, 24 Sep 2014 18:46:47 +0200

Hi,

On Wed, Sep 24, 2014 at 6:22 PM, manfred riem <manfred.riem_at_oracle.com> wrote:
> Can you go into specific with regards to the attribute you would like to
> see?

Approximately something like:

name:
stateSavingMethod

allowed values:
server/client/[null]

Semantics of the values "server" and "client" would be exactly like
the context param "javax.faces.STATE_SAVING_METHOD", but just per view
instead of for the entire application. [null] (not defining the
attribute, or perhaps find a distinct value instead) would use
whatever method is set globally.

For example:

mypage.xhtml

<f:view stateSavingMethod="client" >

     ...

    <h:form>
        ...
    </h:form>


</f:view>

web.xml

<context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
</context-param>

Requesting /mypage.xhtml would cause the state for that view to be
stored as the value of the hidden input field, despite the "server"
setting for state saving in web.xml.

Kind regards,
Arjan



>
> Thanks!
> Manfred
>
>
> On 9/24/14, 10:48 AM, Arjan Tijms wrote:
>>
>> Hi there,
>>
>> A while ago I created umbrella issue
>> https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1056 that
>> asked for more flexible state saving in JSF.
>>
>> The issue being an umbrella issue actually asks for a couple of more
>> specific things, but all about where state is saved, not how state is
>> saved.
>>
>> Perhaps the most important part of the issue is the ability to set per
>> view whether state is saved on the server or the client. Currently
>> this can only be set globally for the entire application.
>>
>> I looked in the RI code a while ago and did some experiments with a
>> custom build and the per view setting seemed doable. An attribute on
>> f:view would be the most straightforward place to set this I guess.
>>
>> I wonder what your thoughts about this are.
>>
>> Kind regards,
>> Arjan Tijms