================================================web.xml==============================================
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0"> <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring.xml</param-value>
</context-param>
<!--配置监听器-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <!--配置OpenSessionInView,需要配置在struts过滤器之前,否则会被过滤掉-->
<filter>
<filter-name>openSessionInView</filter-name>
<filter-class>org.springframework.orm.hibernate5.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>openSessionInView</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <!-- Struts核心过滤器 -->
<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>
</web-app>
================================================spring.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:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd"> <!--开启注解-->
<context:annotation-config/>
<!--告知spring要去哪个包找注解-->
<context:component-scan base-package="com.ibeifeng.ssh"/>
<aop:aspectj-autoproxy/> <bean name="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<!--配置数据库信息-->
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/houserent"/>
<property name="username" value="root"/>
<property name="password" value="123456"/>
</bean> <!--配置session信息-->
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="myDataSource"/>
<!--由于这里我们使用的是注解的方式得到属性,因此使用packagesToScan,
若在hibernate中使用hibernate.cfg.xml则在此处就使用mappingResources,
作用是指定从哪个包中查找注解的model-->
<property name="packagesToScan">
<value>com.ibeifeng.ssh.model</value>
</property>
<!--配置hibernate属性-->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean> <bean id="txManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<!--注入sessionFactory-->
<!--<property name="dataSource" ref="myDataSource"/>-->
<property name="sessionFactory" ref="sessionFactory"/>
</bean> <!--配置事务增强,以及哪些方法使用什么样的规则-->
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<!--*号表示所有的方法都加入事务-->
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice> <!--spring事务的实现是基于AOP方式-->
<aop:config>
<!--定义切入点-->
<aop:pointcut id="allMethod" expression="execution(* com.ibeifeng.ssh.dao.*.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="allMethod"/>
</aop:config>
</beans>

================================================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.devMode" value="true"/>
<constant name="struts.enable.DynamicMethodInvocation" value="true"/>
<package name="default" extends="struts-default"> <!--使用通配符-->
<action name="*_*" class="{1}Controller" method="{2}">
<result name="success">{1}/{2}.jsp</result>
</action>
</package>
</struts>

================================================Employee.java==============================================

package com.ssh.model;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

@Entity
@Table(name = "t_emp")
public class Employee {
private int id;
private String name;
private String salary; public Employee(){} public Employee(int id, String name, String salary) {
this.id = id;
this.name = name;
this.salary = salary;
} @Id
@GenericGenerator(name = "increment", strategy = "increment")
@GeneratedValue(generator = "increment")
public int getId() {
return id;
} public void setId(int id) {
this.id = id;
} @Column(name = "name")
public String getName() {
return name;
} public void setName(String name) {
this.name = name;
} @Column(name = "salary")
public String getSalary() {
return salary;
} public void setSalary(String salary) {
this.salary = salary;
} @Override
public String toString() {
return "Employee{" +
"id=" + id +
", name='" + name + '\'' +
", salary='" + salary + '\'' +
'}';
}
}

================================================Group.java==============================================
package com.ssh.model;

import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; @Entity
@Table(name="t_group")
public class Group {
private int id;
private String name; public Group(){} public Group(int id, String name) {
this.id = id;
this.name = name;
} @Id
@GenericGenerator(name = "increment",strategy = "increment")
@GeneratedValue(generator = "increment")
public int getId() {
return id;
} public void setId(int id) {
this.id = id;
} @Column(name="name")
public String getName() {
return name;
} public void setName(String name) {
this.name = name;
} @Override
public String toString() {
return "Group{" +
"id=" + id +
", name='" + name + '\'' +
'}';
}
}

================================================BaseDao.java==============================================

package com.ssh.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.query.Query; import javax.annotation.Resource;
import java.lang.reflect.ParameterizedType;
import java.util.List; public class BaseDao<T> implements IBaseDao<T> {
private SessionFactory sessionFactory; @Resource
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
} public Session getSession(){
return sessionFactory.openSession();
} @Override
public void add(T t) {
getSession().save(t);
} @Override
public void update(T t) {
getSession().update(t);
} @Override
public void delete(int id) {
getSession().delete(id);
} public Class<T> getCla(){
return (Class<T>)(((ParameterizedType)
(this.getClass().getGenericSuperclass()))
.getActualTypeArguments()[0]);
} @Override
public T load(int id) {
/*由于在load()方法中需要给一个类作为参数,但现在还不知道具体是哪个类,因此需要
一个得到类的方法getCla()
*/
//在这里若使用load()方法需要在web.xml里面配置OpenSessionInView的过滤器,若使用get()则不要
//return this.getHibernateTemplate().get(getCla(),id);
return getSession().load(getCla(),id);
} //查询集合
@Override
public List<T> list(String hql) {
Query query = getSession().createQuery(hql);
return query.list();
} //带参数的集合查询
@Override
public List<T> list(String hql, Object[] params) {
Query query = getSession().createQuery(hql);
//判断参数是否为空
if(params != null && params.length > 0){
for(int i=0; i<params.length; i++){
query.setParameter(i,params[i]);
}
}
return query.list();
} //带参数的分页查询
@Override
public List<T> list(String hql, Object[] params, int pageIndex, int pageSize) {
Query query = getSession().createQuery(hql);
//判断参数是否为空
if(params != null && params.length > 0) {
for (int i = 0; i < params.length; i++) {
query.setParameter(i, params[i]);
}
}
return query.setFirstResult(pageIndex).setMaxResults(pageSize).list();
} //获取总记录数
@Override
public Long count(String hql) {
return (Long) getSession().createQuery(hql).uniqueResult();
} @Override
public Long count(String hql, Object[] params) {
Query query = getSession().createQuery(hql);
//判断参数是否为空
if(params != null && params.length > 0) {
for (int i = 0; i < params.length; i++) {
query.setParameter(i, params[i]);
}
}
return (Long)query.uniqueResult();
}
}

================================================EmpDao.java==============================================
package com.ssh.dao;

import com.ssh.model.Employee;

public class EmpDao extends BaseDao<Employee> implements IEmpDao {
}

================================================GroupDao.java==============================================
package com.ssh.dao;
import com.ssh.model.Group;
import org.springframework.stereotype.Repository; @Repository
public class GroupDao extends BaseDao<Group> implements IGroupDao { }

================================================IBaseDao.java==============================================
package com.ssh.dao;

import java.util.List;

public interface IBaseDao<T> {
public void add(T t);
public void update(T t);
public void delete(int id);
public T load(int id);
public List<T> list(String hql);
public List<T> list(String hql, Object[] params);
public List<T> list(String hql, Object[] params, int pageIndex, int pageSize);
public Long count(String hql);
public Long count(String hql, Object[] params);
}

================================================IEmpDao.java==============================================

package com.ssh.dao;

import com.ssh.model.Employee;

public interface IEmpDao extends IBaseDao<Employee> {
}

================================================IGroupDao.java==============================================

package com.ssh.dao;

import com.ssh.model.Group;

public interface IGroupDao extends IBaseDao<Group>{
}

================================================GroupService.java==============================================

package com.ssh.service;

import com.ssh.dao.IGroupDao;
import com.ssh.model.Group;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List; @Service
public class GroupService implements IGroupService {
private IGroupDao groupDao; @Resource
public void setGroupDao(IGroupDao groupDao) {
this.groupDao = groupDao;
} @Override
public void save(Group group) {
groupDao.add(group);
} @Override
public Group load(int id) {
return null;
} @Override
public List<Group> list(){
//此处的from后面只能写类名
String hql = "from Group";
return groupDao.list(hql);
} @Override
public List<Group> list(int pageIndex, int pageSize) {
String hql = "from Group";
return groupDao.list(hql,null,pageIndex,pageSize);
}
}

================================================IGroupService.java==============================================

package com.ssh.service;

import com.ssh.model.Group;
import java.util.List; public interface IGroupService {
public void save(Group group);
public Group load(int id);
//GroupService需要使用哪些方法只要在接口中添加即可
public List<Group> list();
public List<Group> list(int pageIndex, int pageSize);
}

================================================GroupController.java==============================================

package com.ssh.controller;

import com.ssh.model.Group;
import com.ssh.service.IGroupService;
import com.opensymphony.xwork2.ActionContext;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
import java.util.List; @Controller("groupController")
public class GroupController {
private IGroupService groupService;
//需要保存哪些类的数据,就在这里定义哪些类来接收数据
private Group group;
private int pageIndex=1;
private int pageSize=2; public int getPageIndex() {
return pageIndex;
} public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
} public int getPageSize() {
return pageSize;
} public void setPageSize(int pageSize) {
this.pageSize = pageSize;
} public Group getGroup() {
return group;
} public void setGroup(Group group) {
this.group = group;
} @Resource
public void setGroupService(IGroupService groupService) {
this.groupService = groupService;
} public String add(){
groupService.save(group);
return "success";
} //分页查询
public String list(){
// List<Group> groups = groupService.list();
List<Group> groups = groupService.list(pageIndex,pageSize);
ActionContext.getContext().put("group",groups);
return "success";
}
}

===========================遇到的问题========================

java.lang.NullPointerException
com.ibeifeng.ssh.dao.BaseDao.getSession(BaseDao.java:13)
com.ibeifeng.ssh.dao.BaseDao.list(BaseDao.java:50)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction

(TransactionAspectSupport.java:294)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
com.sun.proxy.$Proxy37.list(Unknown Source)
com.ibeifeng.ssh.service.GroupService.list(GroupService.java:31)
com.ibeifeng.ssh.controller.GroupController.add(GroupController.java:31)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:897)
ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1299)
ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)
com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:117)
com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:108)
ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1375)
ognl.ASTMethod.getValueBody(ASTMethod.java:91)
ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
ognl.SimpleNode.getValue(SimpleNode.java:258)
ognl.Ognl.getValue(Ognl.java:470)
ognl.Ognl.getValue(Ognl.java:434)
com.opensymphony.xwork2.ognl.OgnlUtil$3.execute(OgnlUtil.java:362)
com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:414)
com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:360)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:430)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:290)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:251)
org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:168)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept

(AnnotationValidationInterceptor.java:76)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:125)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:253)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:140)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:575)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:152)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1139)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2555)
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2544)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Unknown Source)


解决方法:错误提示中显示BaseDao方法中,语句"return sessionFactory.openSession()"存在问题,经调试后发现是因为没有注册

sessionFactory变量的原因,给sessionFactory添加getter&setter方法


SSH框架整合3——原生态SessionFactory的更多相关文章

  1. SSH框架整合

    SSH框架整合 一.原理图 action:(struts2) 1.获取表单的数据 2.表单的验证,例如非空验证,email验证等 3.调用service,并把数据传递给service Service: ...

  2. Spring+Hibernate+Struts(SSH)框架整合

    SSH框架整合 前言:有人说,现在还是流行主流框架,SSM都出来很久了,更不要说SSH.我不以为然.现在许多公司所用的老项目还是ssh,如果改成流行框架,需要成本.比如金融IT这一块,数据库dao层还 ...

  3. SSH框架整合的其它方式

    --------------------siwuxie095 SSH 框架整合的其它方式 1.主要是整合 Spring 框架和 Hibernate 框架时,可以不写 Hibernate 核心配置文件: ...

  4. SSH框架整合过程总结

    ---------------------siwuxie095                                 SSH 框架整合过程总结         (一)导入相关 jar 包(共 ...

  5. SSH框架整合思想

    --------------------siwuxie095                                 SSH 框架整合思想         1.SSH 框架,即 Struts2 ...

  6. SSH 框架整合总结

    1. 搭建Struts2 环境 创建 struts2 的配置文件: struts.xml; 在 web.xml 中配置 struts2 的核心过滤器; // struts.xml <?xml v ...

  7. dwr与ssh框架整合教程

    (1)dwr与ssh框架整合教程dwr框架介绍. DWR(Direct Web Remoting)是一个用于改善web页面与Java类交互的远程服务器端Ajax开源框架,可以帮助开 发人员开发包含AJ ...

  8. ssh框架整合之登录以及增删改查

    1.首先阐述一下我用得开发工具,myeclipse2017+oracle,所以我的基本配置步骤可能不一样,下面我用几张图来详解我的开发步骤. ---1先配置structs (Target 选择apac ...

  9. J2EE进阶(十)SSH框架整合常见问题汇总(一)

    SSH框架整合常见问题汇总(一) 前言 以下所列问题具有针对性,但是遇到同类型问题时均可按照此思路进行解决. HTTP Status 404 - No result defined for actio ...

随机推荐

  1. 【开发工具】- Idea.2018.02注册码激活

    1.从下面地址下载一个jar包,名称是  JetbrainsCrack-3.1-release-enc.jar 下载地址: 链接: https://pan.baidu.com/s/1VZjklI3qh ...

  2. Ajax实现异步请求

    基本步骤:创建XMLHttpRequest对象-->配置发送参数-->执行发送-->处理响应 ajax 通俗讲有四个步骤 1.创建Ajax对象2.链接到服务器3.发送请求4.接受返回 ...

  3. ETL讲解

    ETL是将业务系统的数据经过抽取.清洗转换之后加载到数据仓库的过程,目的是将企业中的分散.零乱.标准不统一的数据整合到一起,为企业的决策提供分析依据. ETL是BI项目重要的一个环节. 通常情况下,在 ...

  4. php审核流程详解

    在公司运营中,人员的变动及请假.离职情况都很普遍,这就需要有一个管理系统来系统的做一套流程,可以提升工作效率节省时间.在流程中需要有顺序的进行提交审核,接下来我们做一套简单的新建流程以及提交审核的系统 ...

  5. CentOS7安装MySQL5.7及Tomcat8.5

    在CentOS7服务器上部署FR项目应用 一.安装CentOS-7_x86_64 1.CentOS7:带GUI的服务器(FTP服务器.JAVA平台.兼容性程序库.开发工具.安全性工具.系统管理工具): ...

  6. 如何更改scratch3.0的文字

    首先,我们来看以下的图,我们需要更改scratch3.0的文字,例如文件,新作品,从电脑上传等文字. 打开源码,目录src/compents/menu-bar/menu-bar.jsx 大家会发现,所 ...

  7. MySQL:主键、外键、索引(一)

    干货: 主键是关系表中记录的唯一标识.主键的选取非常重要:主键不要带有业务含义,而应该使用BIGINT自增或者GUID类型.主键也不应该允许NULL.可以使用多个列作为联合主键,但联合主键并不常用. ...

  8. 模型融合---CatBoost 调参总结

    一.参数速查 1.通用参数 2.性能参数 3.处理单元设置 二.分类 三.回归

  9. 在命令行中执行kms命令激活Microsoft Office 2010

    激活office2010的命令是什么?激活office2010除了使用office2010激活工具之外,还可以使用kms命令来激活office2010,但是office2010激活命令还需考虑32位或 ...

  10. LOJ#2343. 「JOI 2016 Final」集邮比赛 2

    题目地址 https://loj.ac/problem/2343 题解 首先处理出\(f[i]\)表示以当前位置开头(J,O,I)的合法方案数.这个显然可以\(O(n)\)处理出来.然后考虑在每个位置 ...