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" />
<!-- 配置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>