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

[jsr372-experts] Re: Features from JSF Managed Beans not present in CDI

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Wed, 14 Dec 2016 18:56:00 +0100

Hi Leo,

On Wed, Dec 14, 2016 at 12:19 AM, Leonardo Uribe <leonardo.uribe_at_irian.at>
wrote:

> - Is there any plans to include an @Eager annotation or something similar
> in order to provide the same behavior for @ManagedBean(eager="true")?
>

This feature is largely provided by CDI natively, namely via the @Observes
@Initialized(ApplicationScoped.class) construct. See Romain's blog post
about this here:
https://rmannibucau.wordpress.com/2015/03/10/cdi-and-startup

There's also a CDI issue for this specifically here:
https://issues.jboss.org/browse/CDI-473

Going beyond the spec, there's third party support for eagerly
instantiating CDI beans via OmniFaces:
http://showcase.omnifaces.org/cdi/Eager



> - Is there any plans to include something similar to
> @ManagedProperty(value="#{mybean}"), or we will rely on what @Inject
> already provides?
>

There's a direct CDI replacement for that provided by JSF 2.3. It's in the
 javax.faces.annotation package. See
http://arjan-tijms.omnifaces.org/p/jsf-23.html#1418

Hope this cleared things up.

Kind regards,
Arjan Tijms





>
> regards,
>
> Leonardo Uribe
>