合ssh
思路,用spring 管理 struts 的action ,与hibernate 的dao 持久层。
先载入jar包,在myeclipse里 增加 struts 增加 hibernate 增加 spring。
然后去网上下载 最新的ssh jar包,覆盖调 web-info\lib\的所有jar包。
因为myeclipse 里的版本可能继承的是很老的包,所以建议在网上下最新的。
第一步,配置struts ,跟原来的配置一样,唯一不同的是。
<action name="IndexActionForm" path="/indexAction"
scope="request" type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="scuess" path="/index.jsp"></forward>
</action>
type用到了spring的一个代理 action。
第二步 配置hibernate,我们打开hibernate.cfg.xml
设置一系列的参数。
....