经历了四个月的学习,中间过程曲折离奇,好在坚持下来了,也到了最后框架的整合中间过程也只有自己能体会了。

接下来开始说一下整合中的问题和技巧:

1,  jar包导入

    c3p0(2个)、jdbc(1个)、spring(15个)、Hibernate(10个)、Struts2(13个)、json(3个)

    及EasyUI的jquery包

2, 在src目录下新建一个实体类的包,并新建一个实体类

package com.han.entity;import java.util.Date;public class Student {private String sno ;private String sname ;private String ssex ;private Date sbirthday ;private String sclass ;/*省略set、get方法*/
}

3, 生成hibernate.cfg.xml的文件,并生成实体类的 Student.hbm.xml

  值得提的是cfg.xml中并不需要连接数据库的驱动、用户名、用户密码及文件的映射,因为在spring中我们会添加这些配置

4, 这里我们用的是连接池连接数据库

  db.properties的配置(放在src下面):

5, 接下来我们在app.xml配置中声明事务及事务的切点

6, 我们建如下包,并分别在对应包中建新的接口和实现类

7, 接下来我们开始Struts2的配置

  这里要注意的是Action的name这里要与网页中发送地址对应,class对应的则是aap.xml中的id名,这里整合spring的话class不能写类的限定名,不然会有空指针异常,method就是Action这个类中的方法名

8, 这里整合spring所以我们都定义了接口及其实现类

9, 在service层中我们定义了一个dao接口的实例化作为属性,并设置了set方法

10, 到这里基本的环境搭建就完成了

下面是每个层的具体方法:

dao层接口

package com.hanqi.dao;import java.util.List;
import java.util.Map;import com.han.entity.Student;public interface StudentDAO {//获取分页数据集合List<Student> find(int page, int rows, String sort, Map<String, String> map) ;//获取数据条数int findTotal(Map<String, String> map) ;//添加数据void add(Student stu) ;
}

dao层接口的实现类impl

package com.hanqi.dao.impl;import java.util.ArrayList;
import java.util.List;
import java.util.Map;import org.hibernate.Query;
import org.hibernate.SessionFactory;import com.han.entity.Student;
import com.hanqi.dao.StudentDAO;public class StudentDAOImpl implements StudentDAO {private SessionFactory sessionFactory ;public void setSessionFactory(SessionFactory sessionFactory) {this.sessionFactory = sessionFactory;}@Overridepublic List<Student> find(int page, int rows, String sort, Map<String, String> map) {List<Student> list = new ArrayList<>() ;//定义list变量并实例化
        String sql = "from Student where 1=1 " ; //创建基础HQL语句
        String snames = map.get("snames") ;//接收参数if(snames != null && !snames.equals(""))//判断参数
        {sql += "and sname =:snames " ;//
        }String sclasss = map.get("sclasss") ;if(sclasss != null && !sclasss.equals("")){sql += "and sclass =:sclasss " ;}if(sort != null && !sort.equals("")){sql += "order by " + sort ;}Query qu = sessionFactory.getCurrentSession().createQuery(sql) ;if(snames != null && !snames.equals("")){qu.setString("snames", snames) ;}if(sclasss != null && !sclasss.equals("")){qu.setString("sclasss", sclasss) ;}//System.out.println(sql);list = qu.setMaxResults(rows)//每页行数.setFirstResult((page-1)*rows)//起始页码
                     .list() ;return list ;}@Overridepublic int findTotal(Map<String, String> map) {int rtn = 0 ;//定义变量并赋值
        String sql = "select count(1) from Student where 1=1 " ;String snames = map.get("snames") ;//接收参数if(snames != null && !snames.equals(""))//判断参数
        {sql += "and sname =:snames " ;//
        }String sclasss = map.get("sclasss") ;if(sclasss != null && !sclasss.equals("")){sql += "and sclass =:sclasss " ;}Query qu = sessionFactory.getCurrentSession().createQuery(sql) ;    //获取Query对象if(snames != null && !snames.equals("")){qu.setString("snames", snames) ;}if(sclasss != null && !sclasss.equals("")){qu.setString("sclasss", sclasss) ;}List<Object> list = qu.list() ;//定义list变量并实例化if(list != null && list.size() > 0 )//判断获取的集合非空及长度
        {rtn = Integer.parseInt(list.get(0).toString()) ;//给变量rtn赋值
        }return rtn ;//返回变量值
    }@Overridepublic void add(Student stu) {sessionFactory.getCurrentSession().save(stu) ;}}

service层接口

package com.hanqi.service;import java.util.List;
import java.util.Map;import com.han.entity.Student;public interface StudentService {//获取分页数据集合public List<Student> getList(int page, int rows, String sort, Map<String, String> map) ;//获取数据条数int getTotal(Map<String, String> map) ;//查询分页数据,并返回JSONString getPageJSON(int page, int rows, String sort, Map<String, String> map) ;//添加数据void insert(Student stu) ;
}

service层接口的实现类impl

package com.hanqi.service.impl;import java.util.List;
import java.util.Map;import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hanqi.service.PageJSON;
import com.han.entity.Student;
import com.hanqi.dao.StudentDAO;
import com.hanqi.service.StudentService;public class StudentServiceImpl implements StudentService {private StudentDAO studentDAO ;public void setStudentDAO(StudentDAO studentDAO) {this.studentDAO = studentDAO;}@Overridepublic List<Student> getList(int page, int rows, String sort, Map<String, String> map) {return studentDAO.find(page, rows, sort, map) ;}@Overridepublic int getTotal(Map<String, String> map) {return studentDAO.findTotal(map) ;}@Overridepublic String getPageJSON(int page, int rows, String sort, Map<String, String> map) {PageJSON<Student> pj = new PageJSON<Student>() ; String rtn = "{\"total\":0,\"rows\":[ ]}" ;//转义字符int total = studentDAO.findTotal(map) ;if(total > 0){List<Student> list = studentDAO.find(page, rows, sort, map) ;//将List集合转为JSON集合String json_list = JSONArray.toJSONString(list) ;pj.setRows(list);pj.setTotal(total);rtn = JSONObject.toJSONString(pj) ;//转义字符返回复合类型的JSON字符串//rtn =  "{\"total\":"+total+",\"rows\":"+json_list+"}" ;
        }return rtn ;}@Overridepublic void insert(Student stu) {studentDAO.add(stu); }}

action类(这里用的域模型来接受从页面传递过来的参数,即直接定义名字相同的属性值,并生成set、get方法)

package com.hanqi.action;import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;import javax.servlet.http.HttpServletResponse;import org.apache.struts2.ServletActionContext;import com.han.entity.Student;
import com.hanqi.service.StudentService;public class StudentAction {private StudentService studentService ;public void setStudentService(StudentService studentService) {this.studentService = studentService;}public StudentService getStudentService() {return studentService;}private int page ;private int rows ;private String sort ;private String order ;private String snames ;private String sclasss ;@Overridepublic String toString() {return "StudentAction [page=" + page + ", rows=" + rows + ", sort=" + sort + ", order=" + order + ", snames="+ snames + ", sclasss=" + sclasss + "]";}public int getPage() {return page;}public void setPage(int page) {this.page = page;}public int getRows() {return rows;}public void setRows(int rows) {this.rows = rows;}public String getSort() {return sort;}public void setSort(String sort) {this.sort = sort;}public String getOrder() {return order;}public void setOrder(String order) {this.order = order;}public String getSnames() {return snames;}public void setSnames(String snames) {this.snames = snames;}public String getSclasss() {return sclasss;}public void setSclasss(String sclasss) {this.sclasss = sclasss;}public void getStudentList(){System.out.println(this);try{//查询参数if(snames != null){snames =new String(snames.getBytes("ISO-8859-1"),"UTF-8") ;//转码
            }if(sclasss != null){sclasss =new String(sclasss.getBytes("ISO-8859-1"),"UTF-8") ;//转码
            }System.out.println("snames = "+ snames );System.out.println("sclasss = " + sclasss );Map<String, String> map = new HashMap<String, String>() ;map.put("snames", snames) ;map.put("sclasss", sclasss) ;//            map.put("snames","刘四") ;
//            map.put("sclasss", "11111") ;String ls = "" ;System.out.println(order +"=" +sort);if(sort != null && order != null){ls = sort + " " + order ;}String json_list = studentService.getPageJSON(page, rows, ls, map) ;//返回数据//System.out.println("json = "+json_list);
            HttpServletResponse response = ServletActionContext.getResponse();response.setCharacterEncoding("UTF-8");response.getWriter().write(json_list) ;}catch(Exception e){e.printStackTrace();}}//接收参数private String sno  ;private String sname ;private String ssex ;private String sclass ;private String sbirthday ;public String getSno() {return sno;}public void setSno(String sno) {this.sno = sno;}public String getSname() {return sname;}public void setSname(String sname) {this.sname = sname;}public String getSsex() {return ssex;}public void setSsex(String ssex) {this.ssex = ssex;}public String getSclass() {return sclass;}public void setSclass(String sclass) {this.sclass = sclass;}public String getSbirthday() {return sbirthday;}public void setSbirthday(String sbirthday) {this.sbirthday = sbirthday;}public void insert() throws IOException{if(sno != null  ){String msg ;try{Student stu = new Student();stu.setSclass(sclass);stu.setSname(sname);stu.setSno(sno);stu.setSsex(ssex); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");stu.setSbirthday(sdf.parse(sbirthday)); studentService.insert(stu); msg = "{'success':true,'message':'保存成功'}" ;}catch(Exception e){msg = "{'success':false,'message':'保存失败'}";System.out.println("yichanghaha");}HttpServletResponse response = ServletActionContext.getResponse();response.setCharacterEncoding("UTF-8");response.getWriter().write(msg);}else{String msg = "{'success':false,'message':'访问异常'}" ;HttpServletResponse response = ServletActionContext.getResponse();response.setCharacterEncoding("UTF-8");response.getWriter().write(msg);}}}

同时在上面的action数据往前台html传送时我们为了返回json格式的字符串更加的方便灵活,我们定义了一个获取json

字符串格式的泛型辅助类,代码如下:

package com.hanqi.service;import java.util.ArrayList;
import java.util.List;public class PageJSON<T> {private int total = 0 ;private List<T> rows = new ArrayList<T>() ;public int getTotal() {return total;}public void setTotal(int total) {this.total = total;}public List<T> getRows() {return rows;}public void setRows(List<T> rows) {this.rows = rows;}}

Struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN""http://struts.apache.org/dtds/struts-2.3.dtd"><struts><!-- 允许调用静态方法和静态属性 --><constant name="struts.ognl.allowStaticMethodAccess" value="true"></constant><constant name="struts.action.extension" value="do,action,,"></constant><package name="stu" extends="struts-default"><action name="studentAction" class="studentAction" method="getStudentList"><!-- name 对应的是网页中的post/get请求 --><!-- 这里的class来源是spring配置中的id名 --><!-- method 方法是Action这个类中的方法 --></action><action name="addstudentAction" class="studentAction" method="insert"><!-- name 对应的是网页中的post/get请求 --><!-- 这里的class来源是spring配置中的id名 --><!-- method 方法是Action这个类中的方法 --></action></package>
</struts>

app.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:p="http://www.springframework.org/schema/p"xmlns:tx="http://www.springframework.org/schema/tx"xmlns:jdbc="http://www.springframework.org/schema/jdbc"xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd"><!-- 基于c3p0连接池的数据源 -->
<!-- 加载外部配置文件 -->
<context:property-placeholder location="classpath:db.properties"/><!-- 连接池 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"><property name="driverClass" value="${jdbc.driver_class}"></property><property name="jdbcUrl" value="${jdbc.url}"></property><property name="user" value="${jdbc.username}"></property><property name="password" value="${jdbc.password}"></property><property name="initialPoolSize" value="${jdbc.initPoolSize}"></property><property name="maxPoolSize" value="${jdbc.maxPoolSize}"></property>
</bean><!-- Hibernate 的 SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"><property name="dataSource" ref="dataSource"></property><!-- 加载Hibernate的配置文件 -->        <property name="configLocation" value="classpath:hibernate.cfg.xml"></property><!-- 映射文件, 可以使用*作为通配符--><property name="mappingLocations" value="classpath:com/han/entity/*.hbm.xml" ></property></bean><!-- bean -->
<!-- DAO -->
<bean id="studentDAOImpl"  class="com.hanqi.dao.impl.StudentDAOImpl"p:sessionFactory-ref="sessionFactory"></bean><!-- Service -->
<bean id="studentServiceImpl" class="com.hanqi.service.impl.StudentServiceImpl" p:studentDAO-ref="studentDAOImpl"></bean><!-- 配置Action -->
<!-- Action 的实例不能是单例的 -->
<bean id="studentAction" class="com.hanqi.action.StudentAction" scope="prototype"
p:studentService-ref="studentServiceImpl"></bean><!-- 声明式事务 -->
<!-- 1.事务管理器 和sessionFactory关联 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"><property name="sessionFactory" ref="sessionFactory"></property>
</bean><!-- 事务通知 -->
<tx:advice id="adv" transaction-manager="transactionManager"><tx:attributes><tx:method name="*"/><!-- 使用事务的方法 --><tx:method name="get" read-only="true"/> <!-- get开头的只读方法,不使用事务 --><tx:method name="find" read-only="true"/> <!-- find开头的只读方法,不使用事务 --></tx:attributes>
</tx:advice><!-- 事务切点 -->
<aop:config><aop:advisor advice-ref="adv" pointcut="execution(* com.hanqi.service.*.*(..))"/>  <!-- 接口 -->
</aop:config></beans>

Hibernate.cfg.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN""http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration><session-factory ><!--  数据库方案--><property name="hibernate.default_schema">TEST0816</property><!--  数据库方言--><property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property><!--  调试--><property name="hibernate.show_sql">true</property><property name="hibernate.format_sql">true</property><!-- 自动建表方式--><property name="hibernate.hbm2ddl.auto">update</property></session-factory>
</hibernate-configuration>

web.xml(这里同时还配置了过滤器要放在Struts配置之前)

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"><display-name>Test41</display-name><welcome-file-list><welcome-file>index.html</welcome-file><welcome-file>index.htm</welcome-file><welcome-file>index.jsp</welcome-file><welcome-file>default.html</welcome-file><welcome-file>default.htm</welcome-file><welcome-file>default.jsp</welcome-file></welcome-file-list><!-- 过虑器 --><filter><filter-name>encodingFilter</filter-name><filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class><init-param><param-name>encoding</param-name><param-value>UTF-8</param-value></init-param><init-param><param-name>forceEncoding</param-name><param-value>true</param-value></init-param></filter><filter-mapping><filter-name>encodingFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping><!-- 加载 Struts2 过滤器配置 --><filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern></filter-mapping><!-- 加载 spring 配置 --><!-- needed for ContextLoaderListener --><context-param><param-name>contextConfigLocation</param-name><param-value>classpath:app.xml</param-value></context-param><!-- Bootstraps the root web application context before servlet initialization --><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener></web-app>

html(在页面的部分并没有多大改动,只是提交的servlert变成了Struts2的action)

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>77</title>
<!-- 1    jQuery的js包 -->
<script type="text/javascript" src="jquery-easyui-1.4.4/jquery.min.js"></script><!-- 2    css资源 -->
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.4.4/themes/default/easyui.css"><!-- 3    图标资源 -->
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.4.4/themes/icon.css"> <!-- 4    EasyUI的js包 -->
<script type="text/javascript" src="jquery-easyui-1.4.4/jquery.easyui.min.js"></script><!-- 5    本地语言 -->
<script type="text/javascript" src="jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script></head>
<body>
<script type="text/javascript">//把long型日期转为想要类型
function getDate(date)
{//得到日期对象var d = new Date(date) ;//得到年月日var year = d.getFullYear() ;var month = (d.getMonth()+ 1) ;var day = d.getDate() ;//封装var tt = year+"-"+(month<10?"0"+month: month)+"-"+(day<10?"0"+day:day) ;return tt ;}//定义一个type变量,判断修改添加操作
var type = "add" ;$(function(){
$('#dg').datagrid({    url:'studentAction.action', idField:'sno',frozenColumns:[ [ {field:'id',checkbox:true},//复选框
                      {field:'sno',title:'学号',width:100,align:'center'} ] ],columns:[[    {field:'sname',title:'姓名',width:100,align:'center'},    {field:'ssex',title:'性别',width:100,align:'center'},{field:'sbirthday',title:'生日',width:100,align:'center',formatter:function(value, row, index){if(value && value != ""){//var valuee = new Date(value).toLocaleDateString();//return valuee;//调用function方法return getDate(value) ;}else{return  "" ;}}},{field:'sclass',title:'班级',width:100,align:'center'} ]],pagination:true,//分页
    fitColumns:true,//列自适应宽度
    rownumbers:true,//显示行号
    striped:true,//斑马线
    singleSelect:false,//是否单选
    sortName:'sno',//排序字段
    sortOrder:'desc',//排序方式
    remoteSort:true,//服务器端排序
    toolbar:[{iconCls:'icon-reload',text:'刷新',handler:function(){$("#dg").datagrid('reload');}},{iconCls:'icon-search',text:'查询',handler:function(){//序列化查询表单var f =  $("#form2").serialize() ;//alert(f) ;
                            $("#dg").datagrid({url:"studentAction.action?"+f}); $("#form2").form("reset");$("#dg").datagrid('reload'); }},{iconCls:'icon-add',text:'添加',handler:function(){$("#sno").textbox({readonly:false});type = "add" ;//清除表单旧数据
                            $("#form1").form("reset");$("#savestu").dialog('open').dialog('setTitle','New User'); }},{iconCls:'icon-edit',text:'修改',handler:function(){//alert("修改");//设置主键字段为只读模式
                 $("#sno").textbox({readonly:true});type = "edit" ;$("#form1").form("reset");var rt = $("#dg").datagrid('getSelected');//document.write(rt);if(rt){$("#form1").form('load',{sno:rt.sno,sname:rt.sname,sclass:rt.sclass,ssex:rt.ssex,sbirthday:getDate(rt.sbirthday)} ) ;$("#savestu").dialog('open').dialog('setTitle','Edit User'); }else{$.messager.show({title:"提示",msg:"请选中一条记录"});}// $("#editstu").dialog('open') ;
                 }},{iconCls:'icon-delete1',text:'单条删除',handler:function(){var rt = $("#dg").datagrid('getSelected');if(rt){$.messager.confirm('Confirm','Are you sure you want to destroy this user?',function(r){if(r){// alert(rt.sno);
                                        $.post('deleteServlet?sno='+rt.sno,function(result){var msg = eval('('  + result + ')') ;if(msg.success){$("#dg").datagrid('reload');alert(msg.message)}});}})}else{$.messager.show({title:"提示",msg:"请选中一条记录"});}}},{iconCls:'icon-delete1',text:'多条删除',handler:function(){var rt = $("#dg").datagrid('getSelections');//保存选中记录的主键var arr = [] ;for(i in rt){arr.push(rt[i].sno);}// alert(arr);if(rt.length>0){$.messager.confirm('Confirm','Are you sure you want to destroy these users?',function(r){if(r){// alert(rt.sno);
                                        $.post('duoDeleteServlet?arr='+arr,function(result){var msg = eval('('  + result + ')') ;if(msg.success){$("#dg").datagrid('reload');$.messager.show({title:'消息',msg:msg.message})}});}})}else{$.messager.show({title:"提示",msg:"请选中至少一条记录"});}}}]
});
})
</script>
<div id="search" class="easyui-panel"  style="height:80px;width:100%"title="查询条件" data-options="{iconCls:'icon-search',collapsible:true}"><form action=""  id="form2"><br>姓名<input class="easyui-textbox" id="snames" name="snames">班级<input class="easyui-textbox" id="sclasss" name="sclasss">    </form>
</div>
<table id="dg"></table>
<div id="savestu" class="easyui-dialog" style="width:400px;height:300px" data-options="closed:true,modal:true,buttons:[{text:'保存',iconCls:'icon-save',handler:function(){$('#form1').form('submit',{url :'addstudentAction.action?type=' +type,onSubmit:function(){var isValid = $(this).form('validate');if(!isValid){$.messager.show({title:'消息',msg:'提交未通过验证'});}return isValid ;},success:function(data){var msg = eval('('  + data + ')') ;if(msg.success){$('#dg').datagrid('reload');$('#savestu').dialog('close');alert(msg.message);}else{alert(msg.message)}}});}},{text:'取消',iconCls:'icon-cancel',handler:function(){$('#savestu').dialog('close');}}]"><form action="" id="form1" method="post">
<table border="0" width="100%">
<br><br><br><tr><td align="right" width="30%" >学号</td><td><input class="easyui-textbox" id="sno" name="sno"data-options="required:true,validType:'length[3,3]'"></td></tr><tr><td align="right" width="30%">姓名</td><td><input class="easyui-textbox" id="sname" name="sname"data-options="required:true,validType:'length[2,4]'"></td></tr><tr><td align="right" width="30%">性别</td><td><input type="radio" name="ssex" value="男" checked>男<input type="radio" name="ssex" value="女">女</td></tr><tr><td align="right" width="30%">班级</td><td><input class="easyui-textbox" id="sclass" name="sclass"data-options="required:true,validType:'length[5,5]'"></td></tr><tr><td align="right" width="30%">生日</td><td><input class="easyui-datebox" id="sbirthday" name="sbirthday"data-options="required:false,showSeconds:true"></td></tr>
</table>
</form>    </div></div>
</body>
</html>

转载于:https://www.cnblogs.com/20gg-com/p/6198193.html

EasyUI、Struts2、Hibernate、spring 框架整合相关推荐

  1. struts2+ibatis+spring框架整合(二)

    MyBatis3.1.1+Spring3.1.2+Struts2.3.4.1框架整合 先来看目录结构 来看配置文件 applicationContext.xml <?xml version=&q ...

  2. Struts2+Hibernate+Spring 整合示例

    转自:https://blog.csdn.net/tkd03072010/article/details/7468769 Struts2+Hibernate+Spring 整合示例 Spring整合S ...

  3. Struts2 + Hibernate + Spring 以及javaweb模块问题解决(1)

    Struts2 + Hibernate + Spring 以及javaweb模块问题解决 1.资源文件的配置:src文件夹里面要配置,action所在的目录中也要配置. 2.<s: action ...

  4. struts2+hibernate-jpa+Spring+maven 整合(1)

    1.0.0 struts2 与 spring 的整合. 1.1.0 新建maven工程 , 编写pom.xml ,这里只需要简单的添加 一个组件就够了: 在myeclipse 生成的pom.xml 添 ...

  5. 【struts2+hibernate+spring项目实战】实现用户登录功能(ssh)

    一.概述 从今天才开始有时间来总结总结以前自己练习的一些东西,希望总结出来对以后可以更加便捷的来学习,也希望可以帮助到正需要这些东西的同行人,一起学习,共同进步. 二. 登录功能总结 2.1.登录功能 ...

  6. struts2+hibernate+spring配置详解

    #struts2+hibernate+spring配置详解 struts2+hibernate+spring配置详解 哎 ,当初一个人做好难,现在终于弄好了,希望自学这个的能少走些弯路. 以下是自己配 ...

  7. 关于如何利用Struts2,Hibernate,Spring开发电子商业汇票系统

    关于如何利用Struts2,Hibernate,Spring开发电子商业汇票系统. 首先先说说电子商业汇票的种类: 1.电子银行承兑汇票 2.电子商业承兑汇票 另外电子商业汇票与纸票的区别: 电子商业 ...

  8. ssh(Struts+spring+Hibernate)三大框架整合-简述

    ssh(Struts+spring+Hibernate)三大框架配合使用来开发项目,是目前javaee最流行的开发方式,必须掌握: 注意: 为了稳健起见,每加入一个框架,我们就需要测试一下,必须通过才 ...

  9. 浅谈ssh(struts,spring,hibernate三大框架)整合的意义及其精髓

    hibernate工作原理 原理: 1.读取并解析配置文件 2.读取并解析映射信息,创建SessionFactory 3.打开Sesssion 4.创建事务Transation 5.持久化操作 6.提 ...

  10. 【struts2+hibernate+spring项目实战】Spring计时器任务 Spring整合JavaMail(邮件发送)(ssh)

    一.常用数据频度维护 对于系统使用度较高的数据,客户在查看时希望这些数据最好先出现,此时需要为其添加排序规则.在进行排序时,使用次数成为排序的依据.因此需要设置一个字段用来描述某种数据的使用次数,也就 ...

最新文章

  1. 可穿戴医疗设备火爆背后的困境
  2. iphone怎么投屏到电脑_怎么把笔记本无线投屏到电视?好用的电脑投屏电视办法...
  3. 间接寻址级别不同_详解西门子间接寻址之地址寄存器间接寻址
  4. 【PAT乙级】1063 计算谱半径 (20 分)
  5. PHP算法对获取用,连接的字符串用in进行sql查询的php处理方法
  6. python数据变更邮件提醒_如何使python脚本在某些数据更改时自动发送电子邮件?...
  7. C/C++端口复用SO_REUSEADDR(setsockopt参数)
  8. matlab 大数阶乘,紧急求助:怎么用matlab计算1000的阶乘啊?
  9. 数据至上的人工智能时代,哪些公开数据集最适合?
  10. win10 动态磁盘 linux,教你如何将win10系统动态磁盘改成基本磁盘?
  11. 伺服系统(自动控制系统)
  12. 据当前时间获取本学期周次
  13. 点云匹配介绍与ICP算法
  14. 10.8 SNK中国一面面经
  15. 互联网快讯:极米Z6X Pro、极米H3S音画表现出众;快狗打车赴港IPO;vivo回应造车传闻
  16. Win11里面【应用或关闭Windows功能】在哪
  17. MySQL-V5.7 压缩包版安装教程
  18. Linux 自检和 SystemTap
  19. Android压缩图片并且保存到本地内存卡中
  20. 计算机教学质量提升,浅析中等专业学校计算机教学质量提升策略

热门文章

  1. ReactNative TextInput的使用与软键盘
  2. Typecho主题开发---(index.php)
  3. 在Navicat中执行sql语句
  4. [OfficeExcel] OfficeExcel2010 第24讲 宏表函数
  5. 汇编语言之 DUP 套 DUP
  6. 我的创作纪念日,成为创作者的第512天
  7. Python跟我说0.1+0.2!=0.3,难道这么多年的数学白学了?
  8. /dev/kmem /proc/kallsyms
  9. 2021年高压电工考试试卷及高压电工作业考试题库
  10. 极致CG影视角色高级课程