Struts2+Spring在项目中的应用
???? 本文不属原创,只是日常工作的一点总结。下面的工程示例只是展示了最基本的配置,能够测试Hello World通过。
1,web.xml配置;
2,常用三方包;
3,Struts2、Spring Bean配置;
4,log4j、国际化资源文件;
5,三层结构设计;
6,异常体系结构;
7,工程结构图。
?
----------------------------------------------------
?
1,web.xml配置
???? 一个Listener两个Filter,加载Spring容器上下文,初始化struts2中央转发器。
?
?
2、常用三方包
???? struts2、spring、Oracle、数据库连接池驱动包、dom4j、Jackson、POI以及iText等。
????
?
3、Struts2、Spring Bean配置
?
????? struts.xml
?????
?
??? 自定义struts-icc.xml
???
??? 资源文件列表:
?? ?icc_en_US.properties
??? icc_zh_CN.properties
??? icc.properties
?
??? 美国英文资源icc_en_US.properties示例:
???
??????service - > service
?????
???5.3? Action层调用Service接口
??
??
?
??
?
?
?


