首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Struts2 +spring2.5 + hibernate3.2配备记录

2012-12-20 
Struts2 +spring2.5 + hibernate3.2配置记录myeclipse6.5中集成1、添加spring2.5时,添加所有spring开头的所

Struts2 +spring2.5 + hibernate3.2配置记录
myeclipse6.5中集成
1、添加spring2.5时,添加所有spring开头的所有包,以及hibernate2.5
2、手工添加struts2"空项目"中的所有包,还要加入struts2-spring-plugin-2.2.1.1.jar。
3、struts配置struts.xml

<constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />

4、web.xml配置
   <!-- 配置spring的监听器 -->    <context-param>    <param-name>contextConfigLocation</param-name>    <param-value>classpath:applicationContext.xml</param-value></context-param>    <!-- 开启监听 -->    <listener>        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>    </listener>            <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>/*</url-pattern>    </filter-mapping>

热点排行