[jboss-user] [Beginners Corner] - Re: EJB-Injection from JSF in JBoss 4.2.2
NSchweig
do-not-reply at jboss.com
Tue Jun 9 04:44:45 EDT 2009
Hi,
I now work with JBoss 5 but I thinks the following is the solution for 4.2.2 If you have any problems with that please ask again.
in EJB "ShopWebSiteBean":
public @Stateless class ShopWebSiteBean implements ShopWebSite {
|
| public static final String RemoteJNDIName = ShopWebSiteBean.class.getSimpleName() + "/remote";
|
| ..}
from JSF-ManagedBean: "ShopBean":
private ShopWebSite getShopWebSiteBean() {
| try {
| InitialContext ctx = new InitialContext();
| return (ShopWebSite) ctx.lookup("ShopWebSiteBean/remote");
| } catch (Exception e) {
| e.printStackTrace();
| throw new RuntimeException("couldn't lookup ShopWebSiteBean", e);
| }
| }
Hope it helps,
NSchweig
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4236279#4236279
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4236279
More information about the jboss-user
mailing list