基于struts2、hibernate、spring、shiro、MySQL的项目开发
使用maven管理jar包的依赖
< project xmlns = “ http://maven.apache.org/POM/4.0.0 ” xmlns :xsi = “ http://www.w3.org/2001/XMLSchema-instance ” xsi :schemaLocation = “ http:/ /maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd “ >
< modelVersion > 4.0. </ modelVersion >
< groupId > com.dabai </ groupId >
< artifactId > test-parent </ artifactId >
< version > 0.0.-SNAPSHOT </ version >
< 包装 > pom </ packaging >
< name > parent </ name >
< description >父</ description > < properties >
< spring .version> 4.2..RELEASE </ spring .version>
< hibernate .version> 5.0..Final </ hibernate .version>
< struts2 .version> 2.3. </ struts2 .version>
< slf4j .version> 1.6. </ slf4j .version>
< log4j .version> 1.2. </ log4j .version>
< shiro .version> 1.2. </ shiro .version>
</ properties > < dependencies >
< 依赖 >
< groupId > org.springframework </ groupId >
< artifactId > spring-context </ artifactId >
< version > $ {spring.version} </ version >
</ dependency > < 依赖 >
< groupId > org.springframework </ groupId >
< artifactId > spring-context-support </ artifactId >
< version > $ {spring.version} </ version >
</ dependency > < 依赖 >
< groupId > org.springframework </ groupId >
< artifactId > spring-web </ artifactId >
< version > $ {spring.version} </ version >
</ dependency > < 依赖 >
< groupId > org.springframework </ groupId >
< artifactId > spring-orm </ artifactId >
< version > $ {spring.version} </ version >
</ dependency > < 依赖 >
< groupId > org.springframework </ groupId >
< artifactId > spring-beans </ artifactId >
< version > $ {spring.version} </ version >
</ dependency > < 依赖 >
< groupId > org.springframework </ groupId >
< artifactId > spring-core </ artifactId >
< version > $ {spring.version} </ version >
</ dependency > < 依赖 >
< groupId > org.aspectj </ groupId >
< artifactId > aspectjweaver </ artifactId >
< version > 1.7. </ version >
</ dependency > <! - struts2开始- >
< 依赖 >
< groupId > org.apache.struts </ groupId >
< artifactId > struts2-core </ artifactId >
< version > $ {struts2.version} </ version >
<! -排除传递的依赖- >
< exclusions >
< 排除 >
< artifactId > javassist </ artifactId >
< groupId > javassist </ groupId >
</ exclusion >
</ exclusions >
</ dependency >
< 依赖 >
< groupId > org.apache.struts </ groupId >
< artifactId > struts2-spring-plugin </ artifactId >
< version > $ {struts2.version} </ version >
</ dependency >
< 依赖 >
< groupId > org.apache.struts </ groupId >
< artifactId > struts2-convention-plugin </ artifactId >
< version > $ {struts2.version} </ version >
</ dependency >
<! - struts2 end - > <! - hibernate begin - >
< 依赖 >
< groupId > org.hibernate </ groupId >
< artifactId > hibernate-core </ artifactId >
< version > $ {hibernate.version} </ version >
</ dependency >
<! - hibernate end - > <! - log start - >
< 依赖 >
< groupId > log4j </ groupId >
< artifactId > log4j </ artifactId >
< version > $ {log4j.version} </ version >
</ dependency > < 依赖 >
< groupId > org.slf4j </ groupId >
< artifactId > slf4j-api </ artifactId >
< version > $ {slf4j.version} </ version >
</ dependency > < 依赖 >
< groupId > org.slf4j </ groupId >
< artifactId > slf4j-log4j12 </ artifactId >
< version > $ {slf4j.version} </ version >
</ dependency >
<! - log end - > < 依赖 >
< groupId > org.apache.poi </ groupId >
< artifactId > poi </ artifactId >
< version > 3.11 </ version >
</ dependency > < 依赖 >
< groupId > org.apache.cxf </ groupId >
< artifactId > cxf-rt-frontend-jaxws </ artifactId >
< version > 3.0. </ version >
</ dependency >
< 依赖 >
< groupId > org.apache.cxf </ groupId >
< artifactId > cxf-rt-transports-http </ artifactId >
< version > 3.0. </ version >
</ dependency >
< 依赖 >
< groupId > junit </ groupId >
< artifactId > junit </ artifactId >
< version > 4.10 </ version >
< scope > test </ scope >
</ dependency > <! -加入的servlet和JSP的依赖- >
< 依赖 >
< groupId > javax.servlet </ groupId >
< artifactId > servlet-api </ artifactId >
< version > 2.5 </ version >
< scope >提供</ scope >
</ dependency >
< 依赖 >
< groupId > javax.servlet </ groupId >
< artifactId > jsp-api </ artifactId >
< version > 2.0 </ version >
< scope >提供</ scope >
</ dependency > <! -引入pinyin4J的依赖- >
< 依赖 >
< groupId > com.belerweb </ groupId >
< artifactId > pinyin4j </ artifactId >
< version > 2.5. </ version >
</ dependency > <! -引入JSON-lib中的依赖- >
< 依赖 >
< groupId > net.sf.json-lib </ groupId >
< artifactId > json-lib </ artifactId >
< version > 2.4 </ version >
</ dependency > <! -引入c3p0jar包- >
< 依赖 >
< groupId > c3p0 </ groupId >
< artifactId > c3p0 </ artifactId >
< version > 0.9.1.2 </ version >
</ dependency > <! -引入了Ehcache的依赖- >
< 依赖 >
< groupId > net.sf.ehcache </ groupId >
< artifactId > ehcache-core </ artifactId >
< version > 2.6. </ version >
</ dependency >
<! -引入四郎框架的依赖- >
< 依赖 >
< groupId > org.apache.shiro </ groupId >
< artifactId > shiro-all </ artifactId >
< version > 1.2. </ version >
</ dependency >
<! -引入MySQL的数据库驱动依赖- >
< 依赖 >
< groupId > mysql </ groupId >
< artifactId > mysql-connector-java </ artifactId >
< version > 5.1. </ version >
</ dependency >
</ dependencies >
< build >
<! -插件- >
< plugins >
< 插件 >
< groupId > org.apache.maven.plugins </ groupId >
< artifactId > maven-resources-plugin </ artifactId >
< version > 2.5 </ version >
</ plugin >
< 插件 >
< groupId > org.apache.maven.plugins </ groupId >
< artifactId > maven-compiler-plugin </ artifactId >
< version > 2.3. </ version >
< 配置 >
< source > 1.7 </ source >
< target > 1.7 </ target >
</ configuration >
</ plugin >
<! -引入Tomcat的插件- >
< 插件 >
< groupId > org.apache.tomcat.maven </ groupId >
< artifactId > tomcat7-maven-plugin </ artifactId >
< version > 2.2 </ version >
< 配置 >
< path > / bos </ path >
< port > </ port >
</ configuration >
</ plugin >
</ plugins >
< resources >
< 资源 >
< directory > src / main / java </ directory >
< includes >
< include > ** / *。properties </ include >
< include > ** / *。xml </ include >
</ includes >
< filtering > false </ filtering >
</ resource >
< 资源 >
< directory > src / main / resources </ directory >
< includes >
< include > ** / *。properties </ include >
< include > ** / *。xml </ include >
</ includes >
< filtering > false </ filtering >
</ resource >
</ resources >
</ build > < modules >
< module > test-entity </ module >
< module > test-web </ module >
< module > test-utils </ module >
< module > test-service </ module >
< module > test-dao </ module >
</ modules >
</ project
实体和实体对应的hibernate映射文件
dao层:从上往下是baseDao一个抽取类 ,dao层接口类 dao层实现类

全部代码:https://github.com/Danovercast/study.git
最下面那个是webservice服务调用 是另外一个
基于struts2、hibernate、spring、shiro、MySQL的项目开发的更多相关文章
- 基于Struts2+Hibernate的朋友圈留言网站开发的质量属性
在课堂上我们了解了质量高于功能,质量属性是指影响质量的相关因素,是对质量的描述.现在我们对基于SSH的交友网站开发的质量属性可以从以下几个方向进行分析: (1)可用性: 当错误发生时,使用可用性战术进 ...
- Struts2+Hibernate+Spring 整合示例
转自:https://blog.csdn.net/tkd03072010/article/details/7468769 Struts2+Hibernate+Spring 整合示例 Spring整合S ...
- struts2+hibernate+spring简单整合且java.sql.SQLException: No suitable driver 问题解决
最近上j2ee的课,老师要求整合struts2+hibernate+spring,我自己其实早早地有准备弄的,现在都第9个项目了,无奈自己的思路和头绪把自己带坑了,当然也是经验问题,其实只是用myec ...
- 工作笔记3.手把手教你搭建SSH(struts2+hibernate+spring)环境
上文中我们介绍<工作笔记2.软件开发经常使用工具> 从今天開始本文将教大家怎样进行开发?本文以搭建SSH(struts2+hibernate+spring)框架为例,共分为3步: 1)3个 ...
- 利用Intellij+MAVEN搭建Spring+Mybatis+MySql+SpringMVC项目详解
http://blog.csdn.net/noaman_wgs/article/details/53893948 利用Intellij+MAVEN搭建Spring+Mybatis+MySql+Spri ...
- Hibernate入门2.简单的项目开发实例
Hibernate入门2.简单的项目开发实例 这一节通过一个简单的项目学习Hibernate项目的配置 代码下载 : 链接: http://pan.baidu.com/s/1zlgjl 密码: p34 ...
- 【Hades】ades是一个开源库,基于JPA和Spring构建,通过减少开发工作量显著的改进了数据访问层的实现
几乎每个应用系统都需要通过访问数据来完成工作.要想使用领域设计方法,你就需要为实体类定义和构建资源库来实现领域对象的持久化.目前开发人员经常使用JPA来实现持久化库.JPA让持久化变得非常容易,但是仍 ...
- 基于Vue、web3的以太坊项目开发及交易内幕初探 错误解决总结
基于Vue.web3的以太坊项目开发及交易内幕初探 本文通过宏观和微观两个层面窥探以太坊底层执行逻辑. 宏观层面描述创建并运行一个小型带钱包的发币APP的过程,微观层面是顺藤摸瓜从http api深入 ...
- [置顶] struts2+hibernate+spring整合(annotation版)
本博文使用struts2,hibernate,spring技术整合Web项目,同时分层封装代码,包含model层,DAO层,Service层,Action层. 在整合hibernate时使用annot ...
- springMVC用法 以及一个简单的基于springMVC hibernate spring的配置
替代struts 1 web.xml中配置springmvc中央控制器 <?xml version="1.0" encoding="UTF-8"?> ...
随机推荐
- python基础4--控制流
1.if语句 结构: if condition: do something elif other_condition: do something number = 60 guess = int(inp ...
- [Code+#3] 寻找车位
Description 给定一个大小为 \(n\times m\) 的 \(01\) 矩阵. 要求支持:单点翻转,询问子矩形内部最大正方形. \(n\times m\leq 4\cdot 10^6,n ...
- [争什么! 掺在一起做撒尿牛丸啊! 笨蛋]ASP.NET Core 2.0 + EF6 + Linux +MySql混搭
好消息!特好消息!同时使用ASP.NET Core 2.0和.NET Framework类库还能运行在linux上的方法来啦! 是的,你没有看错!ASP.NET Core 2.0,.NET Frame ...
- Java 学习笔记 两大集合框架Map和Collection
两大框架图解 Collection接口 由第一张图,我们可以知道,Collection接口的子接口有三种,分别是List接口,Set接口和Queue接口 List接口 允许有重复的元素,元素按照添加的 ...
- rocketmq 发送时异常:system busy 和 broker busy 解决方案
记一次 rocketmq 使用时的异常. 这里就不说什么rocketmq 源码啥的了,因为没看过.网上一搜这两个异常 大部分都是什么源码解读,也没说出现后的解决办法(蓝瘦香菇). 大量测试发现: 1. ...
- 关于token和refresh token
最近在做公司的认证系统,总结了如下一番心得. 传统的认证方式一般采用cookie/session来实现,这是我们的出发点. 1.为什么选用token而不选用cookie/session? 本质上tok ...
- jQuery中each循环的跳出和结束
jQuery中each类似于javascript的for循环 但不同于for循环的是在each里面不能使用break结束循环,也不能使用continue来结束本次循环,想要实现类似的功能就只能用ret ...
- https处理的一个过程,对称加密和非对称加密
一,对称加密 所谓对称加密,就是它们在编码时使用的密钥e和解码时一样d(e=d),我们就将其统称为密钥k. 对称加解密的过程如下: 发送端和接收端首先要共享相同的密钥k(即通信前双方都需要知道对应的密 ...
- Monkey测试记录
配置环境变量,不然用不了adb命令 path这里也一样配置一下 命令的各种意思百度一下看看也就知道了 看到一篇博客推荐的一种测试命令,我也直接拿来用了 adb shell monkey -p 你的包名 ...
- c/c++ 继承与多态 容器与继承3
c/c++ 继承与多态 容器与继承2 巩固了容器里放智能指针的用法,但是有个问题,对于使用Basket类的用户来说,必须添加的是智能指针,如果能直接添加一个普通的类的对象的话,用起来就方便的多了,所以 ...