This content has been marked as final.
Show 2 replies
-
1. Re: Injecting bean instances in Servlets/EJBs
alesj Sep 20, 2009 4:07 AM (in response to genman)"genman" wrote:
Looked over the documentation but I didn't really see any explanation or recommendation for how deployed beans are supposed to be accessed through Servlet deployments. Is JNDI the suggested way? Is there support for @javax.annotation.Resource tags for accessing your own beans? (I wonder how JBoss AS implements @Resource...)
There is simple integration that I wrote for Servlet + MC usage:
- http://anonsvn.jboss.org/repos/jbossas/projects/mc-int/trunk/servlet/
- http://anonsvn.jboss.org/repos/jbossas/projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/GrapherServlet.java"genman" wrote:
JNDI might be okay. If so, how can I be sure the Servlet is initialized AFTER my bean is?
You can define explicit dependency.
Afaik WebModule - which is how we deploy servlets - has depends notion.
Although I would have to look where you define them.
You could also add it through jboss-dependency.xml:
- http://www.jboss.org/community/docs/DOC-13178"genman" wrote:
I guess I'm really after something like what Web Beans promises, which is integration of POJOs/dependency injection with JEE.
As an aside, I don't really see any code sharing between Microcontainer, Seam/Web Beans, which is odd, considering the functionality is in many ways similar.
This is exactly what Kabir is working on now:
- http://anonsvn.jboss.org/repos/jbossas/projects/kernel/trunk/webbeans-int/ -
2. Re: Injecting bean instances in Servlets/EJBs
genman Sep 20, 2009 11:28 PM (in response to genman)Thanks for the info.
I want my Web Beans. Really bad.