免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1568 | 回复: 0
打印 上一主题 下一主题

Struts2整合Spring Hibernate的CRUD实例 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-01 20:55 |只看该作者 |倒序浏览

Struts 2 + Spring 2.0 + Hibernate 3.0整合的操作可以参照我的这篇文章
http://bbs.bccn.net/thread-239025-1-1.html
本文提供Struts2整合Spring Hibernate的CRUD的实例的源代码
1. 数据库脚本,数据库采用MySQL 5.0
CREATE TABLE `user` (
`id` int(11) NOT NULL auto_increment,
`username` varchar(32) NOT NULL,
`password` varchar(32) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2. 几个重要的文件
web.xml
  contextConfigLocation
  /WEB-INF/applicationContext*.xml
  struts2
  
   org.apache.struts2.dispatcher.FilterDispatcher
  
  struts2
  /*
  
   org.springframework.web.context.ContextLoaderListener
  
  lazyLoadingFilter
  
   org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
  
  lazyLoadingFilter
  *.action
  /user/userAdd.jsp
applicationContext.xml
  
  
  
  
  
  
  
   
  
  
   
   
     org.hibernate.dialect.MySQLDialect
   
   
  
  
   
    org/ethip/catalog/model/User.hbm.xml
   
  
  
   
  
  
   
  
  
   
  
  
   
  
  
   
  
  
   
  
  
   
  
struts.xml

  
   userList.action
  
  
   /user/userList.jsp
  
  
   userList.action
  
  
   /user/userEdit.jsp
  
  
   userList.action
  

3. 本实例仅实现CRUD功能,没有实现其他的处理,如数据校验、国际化、分页等.
4. 由于附件过大,lib下所有的jar都删掉了,请各位学习者按照上一文的操作导入。
附件是ssh2目录结构



Struts2整合Spring Hibernate的CRUD实例.rar


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/11570/showart_1674775.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP