ssh整合
?
struts2.3.1 hibernate3.6 spring3.1.1
?spring用的是hibernate3还没升级到hiberbate4
?
(1)去网上把ssh三个框架下载下来
? ?1、Struts2 :解压压缩包->apps->struts2-blank->WEB-INF-> 把web.xml里面的filter复制过去
? ? ? 把lib文件夹里面的jar包拷到项目下面,
? ? ? ->src->java->struts.xml和example.xml 拷到src下面
? ?2、Hibernate :->lib->required 里面的jar包拷到项目中
? ?3、Spring :->dist 里面的jar包一样
? ?4、Struts2压缩包下面->lib struts2-spring->plugin-2.3.2.2.jar拷过去
? ?5、需要commons-dbcp.jar ?commons-logging.jar ?commons.pool.jar ?aopalliance.jar?
? ?6、数据库驱动
? ?7、<constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />加入
? ? ? 到Sturts.xml文件中。
? ?8、新建bean.xml?
? ?9、添加spring监听器 ?
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
<!-- default: /WEB-INF/applicationContext.xml -->
</listener>
?
<context-param>
<param-name>contextConfigLocation</param-name>
<!-- <param-value>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml</param-value> ?-->
<param-value>classpath:bean.xml</param-value>
</context-param>
?
(2)问题
1、javax/persistence/EntityListeners notFoundException
? 缺少hibernate_jpa.jar包
像配置文件struts.xml在他的exmaple中都可以找的到,applictionContext.xml 可以再他的开发文档中找到