您的位置:首页 > 其它

ssh整合步骤

2009-08-31 09:29 106 查看
1 添加struts支持
2 建所需的Form Action 及JSP页面
3 建dao类,并set注入到action中
4 建config包,添加spring.xml(aop core web library三个架包)
5 在web.xml中添加contextConfigLocation值为WEB-INF/classes/config/spring.xml
添加contextLoaderListener监听器
6 将想要注入的dao类拖入spring.xml中,命名BeanId即可,然后将action也拖入
spring.xml中,name中写/ca即struts的提交路径,propertities中增加
上边beanid的类
7 在struts-config.xml中自定义中央控制器
<controller processorClass=" org.springframework.web.struts.DelegatingRequestProcessor">
</controller>
8 连接数据库,添加加hibernate3.2支持,四个全选,
sessionFactory:sf,BeanId:ds,不创建工厂,点击finish,然后添加依赖的三个struts架包即可
9 将sf注入到dao类中,dao类中用set方法来注入

10 建实体包,反向数据库中的表.

11在dao类中对数据库的表进行操作数据

12 改造FromBean,

12 删除asm2.23(在spring 2.5aop中找到asm-2.23,点击右键删除,点打开,确定,删除项目,重新导入即可)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: