-
1. Re: weld : how i get with weld a @Applicationscoped bean eager like into jsf mangedbeans jsf?
sfcoy Mar 28, 2013 10:44 PM (in response to maurojavajdeveloper)You seem to be really looking for this behaviour:
{code:java}
import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;
@Startup
@Singleton
class MyApplicationScopedBean {
...
@PostConstruct
void initialise() {
// it seems likely that you want to do something useful here?
}
}
{code}
You can inject this like any other CDI bean and it can live in your web application (no EJB jar required).
-
2. Re: weld : how i get with weld a @Applicationscoped bean eager like into jsf mangedbeans jsf?
maurojavajdeveloper Mar 29, 2013 4:27 AM (in response to sfcoy)tnak you for your response .
But if i would use the @Application at startup for example without EJB ( into a tomcat 7 ) i not have th ejb annotation .
HOw i can realize the same thing?
The :
import javax.ejb.Singleton;
import javax.ejb.Startup;
@Startup
@Singletonit iss a stuff of ejb .
and into tomcat7 for example the ejb is not present.
mauro
-
3. Re: weld : how i get with weld a @Applicationscoped bean eager like into jsf mangedbeans jsf?
sfcoy Mar 29, 2013 7:44 AM (in response to maurojavajdeveloper)Well, this *is* a JBoss AS support forum, so you're going to get JBoss AS/JEE6 solutions.
You may get a better answer on the JBoss Weld User Forum.
-
4. Re: weld : how i get with weld a @Applicationscoped bean eager like into jsf mangedbeans jsf?
nickarls Apr 1, 2013 12:43 PM (in response to maurojavajdeveloper)You might try accessing it in a ServletContext-listener or something. Never tried...