Hi,
JSF 2.3 will bring (up to now) at least 3 new great features that will
require manual activation: WebSocket, class level validation and CDI
managed converters/validators/behaviors.
To be able to use that, a user will need the following context params:
<!-- WebSocket -->
<context-param>
<param-name>javax.faces.ENABLE_CDI_RESOLVER_CHAIN</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.ENABLE_WEBSOCKET_ENDPOINT</param-name>
<param-value>true</param-value>
</context-param>
<!-- Class level validation -->
<context-param>
<param-name>javax.faces.validator.ENABLE_VALIDATE_
WHOLE_BEAN</param-name>
<param-value>true</param-value>
</context-param>
Moreover, the new attribute "managed" needs to be set to true in *all*
converters, validators and behaviors in order for them to be injectable.
Not sure if this option is supported for xml declared components.
While I can (to a point) understand that these features are disabled by
default, to ensure backward compatibility, I just see it quite tedious to
do all that just to use the new features of an udpated library.
I propose to add a new "javax.faces.MAINTAIN_JSF22_STRICT_COMPATIBILITY",
that when disabled:
- Enables CDI resolver chain
- ¿Enables the WebSocket endpoint?
- Enables class level validation (not sure why this can't me enabled by
default anywyay)
- Makes mentioned artifact CDI managed unless contrary stated (annotation
would take precedence over the context param here). The scope of this
setting should be discussed: should it apply only to the WAR where it's
defined, or should it apply also to lib jars? This could be solved by using
faces-config.xml instead of a context param to enable new features.
To go one step further, this param could be disabled by default for
applications containing a 2.3 faces-config.xml file.
What do you think?
Regards,
Guillermo González de Agüero.