基于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"?> ...
随机推荐
- 提升学习算法简述:AdaBoost, GBDT和XGBoost
1. 历史及演进 提升学习算法,又常常被称为Boosting,其主要思想是集成多个弱分类器,然后线性组合成为强分类器.为什么弱分类算法可以通过线性组合形成强分类算法?其实这是有一定的理论基础的.198 ...
- BaseServlet的编写
在BaseServlet之前,需要提及工厂factory去管理dao以及service,以及页面转发或重定向的管理 1.创建一个工厂类,以及一个资源文件,资源文件中以键值对的形式去存储key,以及对应 ...
- JAVA设计模式——开篇
设计模式很重要,重要性我就不再复述了.最主要的是,通常我们在写一定量代码后,常用的方法什么的都熟悉后,想再提高代码能力,我找到的最好的方法还是去学习,理解设计模式.不理解设计模式,看一些开源框架和ja ...
- 阿里巴巴TXD前端小报 - 2019年3月刊
原文:前端小报 - 201903月刊 Fundebug经授权转载,版权归原作者所有. [Alibaba-TXD 前端小报]- 热门前端技术快报,聚焦业界新视界:不知不觉 2019 年已经过去了 1/4 ...
- java-文件读取
1.利用递归读取文件 (1)NotifyFolder.java package com.etc; import java.io.File; import java.io.IOException; im ...
- 第九课 表单及表单控件 html5学习4
表单有由表单域.提示文本.表单3部分构成 一.表单控件 input 控件 1.<input />单标签2.input属性: 可以通过type属性变换形状 value默认值 name名称 c ...
- location.origin兼容IE
if (window["context"] == undefined) { if (!window.location.origin) { window.location.origi ...
- Apex 中文件夹相关的单元测试
Salesforce 中的文件夹 在 Salesforce 中,我们可以建立各种文档.报表.仪表板.电子邮件模板等.它们都被保存在相应的文件夹中. Salesforce 的后端将这些文件夹保存为 Fo ...
- win10系统下安装MySQLdb和pymysql
(1)使用的是Python3.6,想要使用MySQLdb, 需要先在https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient中下载相应版本的包 ...
- WPF:在DataTemplate中使用DataType
DataTemplate中的DataType的功能实际上和Style中的TargetType很类似. 在Style中,使用了TargetType之后,如果不定义Style的Key,那么这个Style将 ...