RWT Standalone and EJB access [message #1073731] |
Thu, 25 July 2013 07:46  |
Eclipse User |
|
|
|
Using servlets, one can easily inject EJBs using the @EJB annotation. Can I achieve the same thing with RAP? Let's consider the following scenario:
@Stateless
public class MyStatelessBean {
public String getApplicationName() {
return "My application";
}
}
public class MyApplication implements EntryPoint {
@EJB
MyStatelessBean myBean;
public int createUI() {
Shell shell = new Shell();
shell.setText(myBean!=null?myBean.getApplicationName():"null");
return 0;
}
}
I've done all the standard plumbing in order to deploy my application to JBoss. And it works, sort of ... But myBean is null.
The question really is:
Can I access my service layer from RAP using annotations and injections?
A kind of E4 approach. Or the only way is JNDI lookup? Obviously using the new operator for creating an object (some part of the UI) prevents the EJB container from injecting into that object, but is there any clever workaround I am missing?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03624 seconds