"Stefan Arentz" wrote : 
  | Scott, that sounds fair. But I'm a bit lost about how that would work 
technically.
  | 
  | Simple use case: I deploy an .ear with an EJB3 archive and a .war 
containing a Struts application that needs to reference EJB3s. Struts is the 
client here. What magic would I have to perform to make @EJB annotations work 
there then?
  | 
  | Can you give me a hint? I'm not sure how this would work.
  | 
  |  S.
  | 

You would need to use an ejb-ref in the web.xml. We still don't have support 
for reference injection on web components. Any pojo within the context of the 
war that declared the ejb-ref could use the enterprise naming form of the ejb 
lookup:


  | <web-app>
  |    <ejb-ref>
  |      <ejb-name>ejb/someEJB</ejb-name>
  | ...
  |      <ejb-link>path-to-ejb-name</ejb-link>
  |    </ejb-ref>
  | </web-app>
  | 
  | ...
  | 
  | InitialContext ctx = new InitialContext()
  | ISomeEJB ejb = (ISomeEJB) ctx.lookup("java:comp/env/ejb/someEJB");
  | 

Here the string used with the jndi lookup is not subject to vendor specific 
defaults as its just a link that the vendor deployer has to resolve.

What Bill suggests would be a way to add annotations on non-javaee components. 
Its a step further than the servlet 2.5 injection support.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3944578#3944578

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3944578


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to