users@javaserverfaces-spec-public.java.net

[jsr344-experts mirror] [jsr344-experts] Re: [220-ViewStateParamNameOnly] PROPOSAL

From: Neil Griffin <neil.griffin_at_portletfaces.org>
Date: Mon, 30 Jan 2012 19:58:46 -0500

Hi Guys,

From the email thread titled "javax.faces.ViewState + ppr case", on 5/6/10, Alexander Smirnov wrote:
> updating state parameter for ALL forms on the page could cause problem for portal
> environment there each portlet keeps its own state that should not be
> updated by requests from others...

From the email thread titled "Pre-JCP filed draft of JSF 2.2 JSR", on 2/28/2011 1:55 PM, Alexander Smirnov wrote:
> - ResponseStateManager.VIEW_STATE_PARAM should be namespaced, or, at least, converted to the configurable value similar to the clientId delimiter. Otherwise, client-side part updates state field for all JSF portlets on the page.

Alexander is right, because in a portlet environment there can be more than one ViewRoot rendered within HTML document (there is one for each portlet).

+1 for Ted's first suggestion: Keep the ID attribute, and take it one step further by prepending the naming container hierarchy (all the way up to PortletNamingContainerUIViewRoot). That would solve the XML requirement of all IDs being unique on a page, and guard against any portlet problems too.

Neil

On Jan 30, 2012, at 10:46 AM, Ted Goddard wrote:

>
> If the value can be modified after the page is initially rendered,
> then it should have both a name "javax.faces.ViewState" and an
> ID determined by the naming container hierarchy so that the following
> works correctly:
>
> <update id="javax.faces.ViewState"><![CDATA[-1470762710634119679:-9198324743075498445]]></update>
>
> Or, javax.faces.ViewState should be handled as a special case, with
> all forms from the same view updated together.
>
> Ted.
>
> On 2012-01-27, at 2:20 PM, Edward Burns wrote:
>
>> If we care about XML correctness, we need to fix this old issue:
>>
>> http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-220
>>
>> The spec [1] requires that the hidden field for the view state must have
>> both a name and an id attribute, and that the value for both must be
>> "javax.faces.ViewState". Naturally, this causes problems when you have
>> multiple forms and want to me XML correct.
>>
>> Mojarra has long had a config param for this,
>> com.sun.faces.enableViewStateIdRendering, which is on true by default,
>> but I'm wondering if we can just modify the spec to remove the
>> requirement to have an "id" attribute.
>>
>> ACTION: Please respond by mid week next week.
>>
>> Thanks,
>>
>> Ed
>>
>> [1] https://maven.java.net/service/local/repositories/snapshots/archive/javax/faces/javax.faces-api/2.2-SNAPSHOT/javax.faces-api-2.2-20120126.091957-54-javadoc.jar/!/javadocs/javax/faces/render/ResponseStateManager.html#VIEW_STATE_PARAM
>> --
>> | edward.burns_at_oracle.com | office: +1 407 458 0017
>> | homepage: | http://ridingthecrest.com/
>
>