资 源 简 介
Struts whith injection ejb
Glassfish mappedName is described in: https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
Example Glassfish:
```
/**
*
* @author Giacomo Stefamo Gabriele
*/
public class SuperAction extends Action{
@EJB(mappedName="java:global/ProvaStrutsEjb/ProvaStrutsEjb-ejb/SessionBean!sessionbean.SessionBeanLocal")
private SessionBeanLocal sessionBean;
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
SuperActionForm sform = (SuperActionForm) form;
sform.setMessage(sessionBean.business());
return mapping.findForward("result");
}
}
## Example Jboss: ##
/**
*
* @author Giacomo Stefamo Gabriele
*/
public class SuperAction extends Action{
@EJB
private SessionBeanLocal sessionBean;
@Override
public ActionForward execute(A