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

[jsr372-experts] Re: [1416] javax.faces.ENABLE_CDI_RESOLVER_CHAIN replaced by @FacesConfig

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Thu, 12 Jan 2017 23:51:34 +0100

Hi,

Some more detail about @FacesConfig and why this replaced (instead of
augmented) javax.faces.ENABLE_CDI_RESOLVER_CHAIN.

The problem is that the feature works by Bean<T> instances being
programmatically added using a CDI extension. A CDI extension is
*not* capable of reading WEB-INF/web.xml from a war archive, which is the
most important and frequently used source for setting the servlet context
parameters as you of course know. There are a number of open issues for
this, with the most important two being:
https://java.net/jira/browse/SERVLET_SPEC-9 and
https://issues.jboss.org/browse/CDI-152. Both were unfortunately not picked
up for Java EE 8 by either spec.

Before we used javax.faces.ENABLE_CDI_RESOLVER_CHAIN to switch setting the
EL resolver chain and internally in the Bean<T> implementation throw an
exception if incorrectly used. Throughout the year this proved to be
unreliable, as the Bean<T> with its name, type and scope would still be
known by CDI, and this would interfere for instance if applications already
had producers or their own Bean<T> instances for the names and/or types
that these build-in Bean<T>s by JSF export.

So the only way of absolutely switching this new functionality off was to
not add them using the CDI extension, and that could only be done by
"something" on the class path, which an annotated class is.

Bauke is currently working on adding the additional constants for
@FacesConfig so this can be included in the spec, after a test is added
(for which I believe we have time until next week),
JAVASERVERFACES_SPEC_PUBLIC-1416 can be closed.

Hope this clears it up, and sorry for the confusion.

Kind regards,
Arjan Tijms








On Thu, Jan 12, 2017 at 10:24 PM, arjan tijms <arjan.tijms_at_gmail.com> wrote:

> Hi,
>
> Should go in spec, but because of an extremely nasty situation with a test
> I have not been able to send the spec text earlier. I hope to do so later
> today before close of business.
>
> Kind regards,
> Arjan
>
> On Thu, Jan 12, 2017 at 10:19 PM, Neil Griffin <
> neil.griffin_at_portletfaces.org> wrote:
>
>> Hi Arjan,
>>
>> Spec section 11.1.3, 5.6.3, and "Changes between 2.2 and 2.3" all mention
>> javax.faces.ENABLE_CDI_RESOLVER_CHAIN
>>
>> However, the param was recently removed in this commit:
>> https://github.com/javaserverfaces/mojarra/commit/a4aa50bf5f
>> 63f194967716be6f0cd60b46a9cd8f#diff-d44ec72213797cad9b0928b1d86d76eb
>>
>> Also in the commit, opt-in for CDI features was replaced by detection of
>> a class annotated with @FacesConfig:
>> https://github.com/javaserverfaces/mojarra/blob/master/jsf-
>> api/src/main/java/javax/faces/annotation/FacesConfig.java
>>
>> Are there any additional details that you think should go into the Spec?
>>
>> Also, should JAVASERVERFACES_SPEC_PUBLIC-1416 be closed?
>> https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1416
>>
>>
>> Best Regards,
>>
>> Neil
>>
>>
>