共有 0 个贴子
没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > struts-di |
struts-di
|
0 | 0 | 5 |
贡献者 | 讨论 | 代码提交 |
Struts-DI is a small library for Java 5.0 (and above) that enables dependency injection (DI) for EJB session beans in Struts 1.x Action classes using the standard Java EE @EJB annotation.
Using Struts-DI is easy:
Include the libary jar file (or the separate class files) in your web application's class path (usually WEB-INF/lib or WEB-INF/classes). Activate one of Struts-DI's request processors in your WEB-INF/struts-config.xml: Or, if you are using Tiles:
That's it :-)
Now you can use @EJB as if your Action classes were Java EE "managed" classes:
public class MyAction extends org.apache.struts.action.Action {
@EJB
private MySessionBean msb;
@Override
public ActionForward execute(...) throws Exception {
String backendResponse = msb.myCall(...);
...
}
}Curre