myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <>
Subject [jira] [Commented] (MYFACES-3786) Web Container injection support should be provided for additional lifecycle artifacts (not just managed beans)
Date Fri, 11 Oct 2013 17:04:43 GMT


Leonardo Uribe commented on MYFACES-3786:

I have attached another patch, I'm still working on the details, but my intention with show
the patch is just provide a reference point for the discussion, so the people can see a possible
alternative to solve this issue.

The default of other web servers is CDIAnnotationInjectionProvider. If the CDI implementation
is correctly set up, it will work in other web servers as well (tested in jetty 8 + OWB),
but I suppose in some cases custom implementations of this interface are required, but that
will be provided by server vendors. Remember not only CDI annotations needs to be handled,
but all JavaEE annotations, and CDI will not be always on the classpath. Without CDI, use
@PostConstruct or @PreDestroy should still be valid.

Can JSF 2.2 work without any CDI library on the classpath? Yes, of course. In that sense,
CDI is optional. It is clear in that mode some features that depends on CDI will not work,
for example CDI @FlowScope and @ViewScope, but note in MyFaces 2.2 now there are 2 new SPI
interfaces for that (FacesFlowProvider and ViewScopeProvider). 

The idea is take care of the invocations to specific CDI api and make sure classes doing does
references are not loaded if they are not required.

In this case, we have cases where we need to call specific constructor methods to support
wrapping and so on. Simply it is not possible to delegate the construction step to CDI, by
all reasons exposed.

The case for converter/validator will not be done in this issue. In this issue, the only concern
for now if implement what the spec says about injection. 

> Web Container injection support should be provided for additional lifecycle artifacts
(not just managed beans)
> --------------------------------------------------------------------------------------------------------------
>                 Key: MYFACES-3786
>                 URL:
>             Project: MyFaces Core
>          Issue Type: Task
>          Components: JSR-344
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>         Attachments:,, cdiPartialViewContext.war,, cdi.patch, cdiphaselistener1.patch, cdiphaselistener2.patch,,
cdiValidator.war, MYFACES-3786-1.patch, MYFACES-3786-2.patch
>  This issue is all about how to inject beans into jsf artifacts.
> See JSF 2.2 section 5.4.1
> The problem here is in some point we need to give the control to the underlying environment
to inject beans into the artifacts, but we don't know much about how to properly do it, so
we need to try with examples.

This message was sent by Atlassian JIRA

View raw message