一、struts

1、添加jar

commons-fileupload-1.3.1.jar,【文件上传相关包】

commons-io-2.2.jar,

commons-lang-2.4.jar ,

commons-lang3-3.2.jar, 【struts对java.lang包的扩展】

freemarker-2.3.19.jar, 【struts的标签模板库jar文件】

ognl-3.0.6.jar,

struts2-core-2.x.jar,   【struts2核心功能包】

struts2-spring-plugin-2.x.jar,

xwork-core-2.x.jar      【Xwork核心包】

到web-inf/lib目录下。

2、添加struts.xml

到src目录下。可在“struts-2.x\apps\struts2-blank\WEB-INF\classes”下复制。

在struts.xml中添加几个常用属性:

 <!-- 禁用动态方法访问 -->
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<!-- 配置成开发模式 -->
<constant name="struts.devMode" value="true" />
<!-- 配置拓展名为action -->
<constant name="struts.action.extention" value="action" />
<!-- 把主题配置成simple -->
<constant name="struts.ui.theme" value="simple" />

3、配置web.xml

    添加struts2 过滤器:

 <filter>
<filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter> <filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>

二、Hibernate

添加hibernate jar

hibernate3.jar,

lib/required/*.jar,

lib\jpa\hibernate-jpa-2.0-api-1.0.0.Final.jar,

lib\bytecode\cglib\cglib-2.2.jar

到web-inf/lib目录下。

至于hibernate.cfg.xml文件,因项目使用spring来整合管理实体和数据库的连接等hibernate原本的工作,所以这个配置文件不再需要。

三、Spring

添加spring3.0.2中的jar

添加spring配置文件applicationContext.xml 到src目录下;

在web.xml中注册spring监听器,启动spring容器:

 <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>

最新文章

  1. HTML5 之拖放(drag与drop)
  2. Linux 内核版本命名
  3. [LeetCode] Count The Repetitions 计数重复个数
  4. 2014年6月份第1周51Aspx源码发布详情
  5. LeetCode() Symmetric Tree
  6. iOS原生项目中集成React Native
  7. Elasticsearch(入门篇)——Query DSL与查询行为
  8. *windows下安装以及配置nginx
  9. Redis是什么?
  10. GoogleProgressBar
  11. javascript系列之核心知识点(二)
  12. Bootstrap 输入组
  13. 解释session
  14. 允许外网连接到云服务器的mongodb服务器
  15. Windows配置Apache服务器
  16. Docker容器中找不到vim命令
  17. pip更换国内源
  18. checkBox全选全不选及数据提交后台
  19. android include使用[转]
  20. Eclipse 写 Python的一些小问题

热门文章

  1. android菜鸟学习笔记15----Android Junit测试
  2. Swift 学习笔记(面向协议编程)
  3. 【题解】P1613跑路
  4. Android实现下拉导航选择菜单效果
  5. SAP RFC 的介绍
  6. me12里更改信息记录的净价和有效价格,以及信息记录的条件价格
  7. JavaScript学习笔记(持续更新)
  8. Java for LeetCode 097 Interleaving String 【HARD】
  9. selector + drawable 多状态图形
  10. vue 的基本语法