dev@javaserverfaces.java.net

Re: Issue #3021

From: Manfred Riem <manfred.riem_at_oracle.com>
Date: Fri, 04 Oct 2013 11:29:53 -0500

OK fix applied see the JIRA issue for its resolution.

Thanks!
Manfred

On 9/17/2013 12:38 PM, Leonardo Uribe wrote:
> Hi Manfred
>
> I think in this case the spec doesn't say anything but it is
> implicitly assumed.
>
> Here is the relevant in the spec:
>
> JSF 2.0 rev A section 10.2.1 Specification of the
> ViewDeclarationLanguage Implementation for
> Facelets for JSF 2.0 :
>
> ".... The argument root will have been created with a call to either
> createView() or ViewMetadata.createMetadataView(). If the root already
> has non-metadata children, this method must return immediately.
> Otherwise, the implementation must examine the viewId of the argument
> root, which must resolve to an entity written in Facelets for JSF 2
> markup language ..."
>
> Typically, in ViewHandler.createView(), it is usually set the
> locale/renderKitId (and contracts in JSF 2.2 spec). Why
> createMetadataView() doesn't have that responsibility too? In fact the
> implementation done in MyFaces call internally createView(), so
> createMetadataView() never returns null.
>
> I think we can fix it safely for 2.0, 2.1 and 2.2. At the end, it is
> an implementation detail related to how the view metadata is applied
> (if there is an f:view tag, the information there is metadata, that's
> it). I can't see any side effect doing the opposite. But maybe the
> spec wording should be fixed a little bit to reflect the fact that
> f:view attributes are metadata too.
>
> In my opinion these 3 attributes:
>
> locale
> contracts
> renderKitId
>
> Are very, very special, are part of the view metadata and defines the
> structure of the view itself, so once initialized they don't change
> over the view lifetime.
>
> regards,
>
> Leonardo Uribe
>
>
>
> 2013/9/17 Manfred Riem <manfred.riem_at_oracle.com
> <mailto:manfred.riem_at_oracle.com>>
>
> Leonardo,
>
> Do you think this can be changed as a bug fix or does it have a
> specification impact?
>
> Regards,
> Manfred
>
>
> On 9/16/2013 4:00 PM, Leonardo Uribe wrote:
>> Hi
>>
>> It looks like a bug. When the view metadata is processed, the
>> outer f:view tag should be taken into account, but it is clear
>> both implementations are not doing anything in this part.
>>
>> regards,
>>
>> Leonardo
>>
>>
>>
>> 2013/9/16 Manfred Riem <manfred.riem_at_oracle.com
>> <mailto:manfred.riem_at_oracle.com>>
>>
>> Hi all,
>>
>> Can someone please respond to the comments below? Thanks!
>>
>> Regards,
>> Manfred
>>
>> ============================================================================
>>
>> Use case:http://stackoverflow.com/q/18495673/157882^
>>
>> In a nutshell: during validations phase of a <f:viewParam> on
>> a GET request,
>> the locale of the UIViewRoot is not yet set with the value as
>> available by
>> <f:view locale="#{sessionBean.locale}">. I've read section
>> 2.5.2.1 of JSF
>> 2.1 spec if the spec confirms this behavior. It states the
>> following:
>>
>> >The UIViewRoot's Locale is determined and set by the
>> ViewHandler during
>> > the execution of the ViewHandler's createView() method.
>> This method must
>> > cause the active Locale to bedetermined by looking at the
>> user's
>> > preferences combined with the application's stated
>> supported locales.
>>
>> What exactly is "user's preferences"?
>>
>> I'd expect that the evaluated value of <f:view locale> would
>> account as
>> an user preference. However, it is only set during beginning
>> of render
>> response phase.
>>
>> Is this a bug or an oversight in the spec?
>>
>>
>>
>
>