SSH整合框架中save方法执行的时候会删除原有数据

SSH整合框架中save方法执行的时候会删除原有数据
如:
Hibernate: delete from stu_tea where tea_id=?
Hibernate: insert into stu_tea (tea_id, stu_id) values (?, ?)

我用的实体类注解方式,多对多关联关系,学生和老师类,执行save的时候每次中间表的关联关系都会被新的关联关系覆盖,看sql语句输出是现实先把原来的删除了,再添加的,检查过自己的配置update这个确定是update不是create;

学生类

 package com.cdd.ssh.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

@Entity
public class Students {
    @Id
    @Column(name="sId")//可省略
    //设置主键自增
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int sId;
    private String sName;
    private String sSex;
    private int sAge;
    @ManyToMany(mappedBy="students",cascade={CascadeType.PERSIST})
    private Set<Teachers> teachers = new HashSet<Teachers>();


    public int getsId() {
        return sId;
    }
    public void setsId(int sId) {
        this.sId = sId;
    }
    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 int getsAge() {
        return sAge;
    }
    public void setsAge(int sAge) {
        this.sAge = sAge;
    }
    public Set<Teachers> getTeachers() {
        return teachers;
    }
    public void setTeachers(Set<Teachers> teachers) {
        this.teachers = teachers;
    };
}

老师类

 package com.cdd.ssh.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
//注明实体类对应表明,省略默认使用类名
@Table(name="teachers")
public class Teachers {
    //表明id列
    @Id
    @Column(name="tId")//可省略
    //设置主键自增
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int tId;
    private String tType;//科目
    private String tName;//姓名
    @ManyToMany(cascade={CascadeType.PERSIST,CascadeType.MERGE}) 
    //设置中间表关联关系
    @JoinTable(name="stu_tea",
            joinColumns ={@JoinColumn(name = "tea_id")},
            inverseJoinColumns={@JoinColumn(name="stu_id")})            
    private Set<Students> students = new HashSet<Students>();


    public int gettId() {
        return tId;
    }
    public void settId(int tId) {
        this.tId = tId;
    }
    public String gettType() {
        return tType;
    }
    public void settType(String tType) {
        this.tType = tType;
    }
    public String gettName() {
        return tName;
    }
    public void settName(String tName) {
        this.tName = tName;
    }
    public Set<Students> getStudents() {
        return students;
    }
    public void setStudents(Set<Students> students) {
        this.students = students;
    }


}

这个是dao中的执行方法

 public void add(Students student, Teachers teacher) {
        // TODO Auto-generated method stub
        Session session = this.getSession();
        student.getTeachers().add(teacher);
        teacher.getStudents().add(student);
        session.save(teacher);
        session.save(student);
        System.out.println(teacher.gettId());
        System.out.println(student.getsId());
    }

这是我的代码,求大神帮忙啊,一下午了都没弄好,

在这之前我是写的学生和教室类,后来感觉教室不合适,就把教室改成老师类了,配置文件和属性都没有改变,只把用到教室的地方换成了老师;

求大神帮忙

这里是applicationContext.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:tx="http://www.springframework.org/schema/tx"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
    http://www.springframework.org/schema/aop 
    http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
    http://www.springframework.org/schema/context   
    http://www.springframework.org/schema/context/spring-context-2.5.xsd
">

      <!-- 开启注解 -->
    <context:annotation-config/>

    <!-- 扫描包设置 -->
    <context:component-scan base-package="com.cdd.ssh.*"></context:component-scan>

    <!--DateSource数据源  使用DBCP连接池-->
    <bean id="dataSource"  class="org.apache.commons.dbcp.BasicDataSource">  
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>  
        <property name="url" value="jdbc:mysql://localhost:3306/school?useUnicode=true&amp;characterEncoding=UTF8"/>  
        <property name="username" value="root"/>  
        <property name="password" value="chengzi"/>  
    </bean>


    <bean id="sessionFactory"   
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    <property name="dataSource" ref="dataSource"></property>

    <!-- 载入实体类      mappingResources -->
    <property name="packagesToScan">
            <value>com.cdd.ssh.entity</value>
        </property>

    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.hbm2ddl.auto">update</prop>
        </props>
    </property>

    </bean>

    <!--  3.~~~~~~~~~~~~~~~~~~~~~~~~~事务配置~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
    <bean id="txManager" 
        class="org.springframework.orm.hibernate3.HibernateTransactionManager" > 
    <property name="sessionFactory" ref="sessionFactory"></property>         
    </bean> 

    <tx:annotation-driven transaction-manager="txManager" /> 

    <aop:config> 
    <aop:pointcut expression="execution(public * com.cdd.ssh.service.*.*(..))" 
        id="bussinessService"/> 
    <aop:advisor advice-ref="txAdvice" pointcut-ref="bussinessService" /> 
    </aop:config> 
    <tx:advice id="txAdvice" transaction-manager="txManager" > 
    <tx:attributes> 
        <tx:method name="query*"  read-only="true" propagation="NOT_SUPPORTED"  /> 
        <!-- get开头的方法不需要在事务中运行 。 
        有些情况是没有必要使用事务的,比如获取数据。开启事务本身对性能是有一定的影响的--> 
        <tx:method name="*"/>    <!-- 其他方法在实务中运行 --> 
    </tx:attributes> 
</tx:advice> 

</beans>
0

3个回答

有人吗???求大神帮忙啊

0

看看你的xml文件,你在update的时候是不是把对象的所有字段都update了,

0
qq_35973977
叫我程子 大神配置文件也贴上去了,帮我看看吧,急死了,
接近 3 年之前 回复
qq_35973977
叫我程子 用的注解方式,只有一个applicationContext.xml和struts.xml,没有hibernate的xml文件,全部整合到applicationContext.xml中了,
接近 3 年之前 回复

找到了,应该是实体类中不能直接初始化set集合,在dao层每次都初始化新的set集合,问题解决了,但是还有一个问题,我自动生成的的中间表的两个关联属性都被自动勾上了主键属性,那我岂不是不能出现多对多关联了吗?这样只能一对一关联了,怎么办呢

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ssh框架整合,save方法无法执行
ssh框架整合,save方法无法执行rn代码如下:rn rn findAllrn addMedicare.jsp rn rn 3000000rn rn image/jpg,image/jpeg,image/pjpeg,image/gif,image/bmprn rn rn rn rn
整合SSH框架的思路及方法
首先在接到一个项目,考虑到用SSH框架比较放心,决定从新开始整合一下SSH框架,好好巩固一下。这篇文章主要是针对初学者(跟我一样的,大牛们看看希望可以指正~~ =_=|||)、 首先我目前的开发环境是Windows10+Tomcat+maven+MySQL+Eclipse。 所谓SSH框架,就是整合了Spring+Struts+Hibernate的一个集成框架,从系统职责上分为四层:表示层、业
SSH整合的时候报错
报错信息如下:rnrn[framework] 2012-05-16 15:25:57,900 - org.apache.struts2.dispatcher.Dispatcher -2984 [main] ERROR org.apache.struts2.dispatcher.Dispatcher - Dispatcher initialization failedrnUnable to load configuration. - [unknown location]rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)rn at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)rn at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)rn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)rn at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:519)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:581)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: Unable to locate parent package [login] - [unknown location]rn at org.apache.struts2.convention.PackageBasedActionConfigBuilder.getPackageConfig(PackageBasedActionConfigBuilder.java:952)rn at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildConfiguration(PackageBasedActionConfigBuilder.java:601)rn at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:336)rn at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:215)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)rn ... 31 morern[framework] 2012-05-16 15:25:57,916 - org.logicalcobwebs.proxool.dbpool -3000 [main] INFO org.logicalcobwebs.proxool.dbpool - Shutting down 'dbpool' pool immediately [main]rn[framework] 2012-05-16 15:25:57,932 - org.logicalcobwebs.proxool.PrototyperController -3016 [main] INFO org.logicalcobwebs.proxool.PrototyperController - Stopping Prototyper threadrn[framework] 2012-05-16 15:25:57,932 - org.logicalcobwebs.proxool.HouseKeeperController -3016 [main] INFO org.logicalcobwebs.proxool.HouseKeeperController - Stopping HouseKeeper threadrnrnrn工程中导入的包有:rnrnantlr-2.7.6.jarrnaopalliance-1.0.jarrnavalon-scratchpad-4.1.jarrncom.springsource.net.sf.cglib-2.2.0.jarrncom.springsource.org.apache.commons.logging-1.1.1.jarrncom.springsource.org.aspectj.weaver-1.6.8.RELEASE.jarrncommons-beanutils-core-1.8.0.jarrncommons-beanutils.jarrncommons-codec-1.4.jarrncommons-collections-3.2.jarrncommons-dbcp-1.4.jarrncommons-digester-2.1.jarrncommons-email-1.2.jarrncommons-fileupload-1.2.1.jarrncommons-io-1.3.2.jarrncommons-lang-2.2.jarrncommons-logging-1.1.1.jarrncommons-pool-1.5.4.jarrndom4j-1.6.1.jarrndwr.jarrnehcache-1.6.0.jarrnezmorph.jarrnfreemarker-2.3.15.jarrnhibernate-jpa-2.0-api-1.0.0.Final.jarrnhibernate3.jarrnhttpclient-4.1.1.jarrnhttpclient-cache-4.1.1.jarrnhttpcore-4.1.jarrnhttpmime-4.1.1.jarrnjavassist-3.9.0.GA.jarrnjavax.inject.jarrnjaxen-1.1-beta-6.jarrnjdom.jarrnjson-lib-2.3-jdk15.jarrnjta-1.1.jarrnjtds-1.2.5.jarrnjxl.jarrnlogback-classic-0.9.20.jarrnlogback-core-0.9.20.jarrnmail.jarrnmybatis-3.0.5.jarrnmybatis-spring-1.0.1.jarrnmysql-connector-java-5.0.8-bin.jarrnognl-3.0.jarrnorg.springframework.aop-3.0.2.RELEASE.jarrnorg.springframework.asm-3.0.2.RELEASE.jarrnorg.springframework.aspects-3.0.2.RELEASE.jarrnorg.springframework.beans-3.0.2.RELEASE.jarrnorg.springframework.context-3.0.2.RELEASE.jarrnorg.springframework.context.support-3.0.2.RELEASE.jarrnorg.springframework.core-3.0.2.RELEASE.jarrnorg.springframework.expression-3.0.2.RELEASE.jarrnorg.springframework.instrument-3.0.2.RELEASE.jarrnorg.springframework.instrument.tomcat-3.0.2.RELEASE.jarrnorg.springframework.jdbc-3.0.2.RELEASE.jarrnorg.springframework.orm-3.0.2.RELEASE.jarrnorg.springframework.test-3.0.2.RELEASE.jarrnorg.springframework.transaction-3.0.2.RELEASE.jarrnorg.springframework.web-3.0.2.RELEASE.jarrnorg.springframework.web.portlet-3.0.2.RELEASE.jarrnorg.springframework.web.servlet-3.0.2.RELEASE.jarrnorg.springframework.web.struts-3.0.2.RELEASE.jarrnpinyin4j-2.5.0.jarrnproxool-0.9.1.jarrnproxool-cglib.jarrnslf4j-api-1.5.11.jarrnstruts2-convention-plugin-2.2.1.1.jarrnstruts2-core-2.2.1.1.jarrnstruts2-dojo-plugin-2.2.1.1.jarrnstruts2-spring-plugin-2.2.1.1.jarrnxwork-core-2.2.1.1.jarrnlog4j-1.2.9.jarrnavalon-excalibur-4.1.jarrnavalon-framework.jarrnavalon-logkit-2.1.jarrn
SSH整合时候的常用配置
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> org.hiberna
SSH整合的时候出现问题
部署到tomcat的时候rn java.lang.ClassCastException: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider cannot be cast to org.hibernate.service.jdbc.connections.spi.ConnectionProviderrnrnThe web application [/SSHXml] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.rn第一次整合怎么就出现这种问题呢
ssh整合测试,执行到getHibernateTemplate().save(T)就报错
Struts Problem ReportrnrnStruts has detected an unhandled exception: rnrnrnMessages: 1.customerActionrn2.Invalid action class configuration that references an unknown class named [customerAction]rn rnFile: org/apache/catalina/loader/WebappClassLoader.java rnLine number: 1,718 rnrnrnrnStacktracesrnrnjava.lang.RuntimeException: Invalid action class configuration that references an unknown class named [customerAction] rn org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:97)rn org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:376)rn org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:272)rn com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:95)rn com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:279)rn org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:48)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:574)rn org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)rn org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)rn org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)rn org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)rn org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)rn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)rn org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)rn org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)rn org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)rn org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)rn org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)rn java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn java.lang.Thread.run(Thread.java:748)rn rnrnjava.lang.ClassNotFoundException: customerAction rn org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718)rn org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)rn com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:179)rn org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:95)rn org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:376)rn org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:272)rn com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:95)rn com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:279)rn org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:48)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:574)rn org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)rn org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)rn org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)rn org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)rn org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)rn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)rn org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)rn org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)rn org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)rn org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)rn org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)rn java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn java.lang.Thread.run(Thread.java:748)rnrnstruts2配置rn rn /jsp/customer/list.jsprn rn /rn CustomerAction_listrn rn rnrnapplicationContext.xml配置rn rn rn rnrnCustomerAction代码(部分)rn public class CustomerAction extends ActionSupport implements ModelDrivenrn private Customer customer = new Customer();rn private CustomerService cs;rnrn public String add() throws Exception rn rn cs.save(customer);rn return "toList";rn rn-------------------------------------------------------------------------------------------------------------------------------------------rndebug了一下,最后执行getHibernateTemplate().save(T),进入到org.apache.struts2.dispatcher.Dispatcher内执行serviceAction()方法内报的错。。。。该怎么解决呢?
清除原有ssh密钥方法
远程连接主机发现密匙发生变化, Add correct host key in /var/root/.ssh/known_hosts to get rid of this message. Offending key in /var/root/.ssh/known_hosts:1 RSA host key for 192.168.1.203 has changed and you
MacOS中清除原有ssh公钥方法
2019独角兽企业重金招聘Python工程师标准&gt;&gt;&gt; ...
SSH框架的基本整合
SSH框架的基本整合 AOP注解方式 编写切面类(包含通知和切入点)开启自动代理 JDBC模板技术 Spring提供模板技术,数据库的操作以后编写DAO层,都可以继承JdbcDaoSupport类(JDBC模板)Spring框架可以整合开源连接池 Spring事务管理 Spring框架事务管理需要接口和概述  PlatformTransac
ssh框架的整合
<br />struts1.x   hibernate  spring框架的整合<br />在applicationContext.xml文件中的配置如下<br /><beans><br />    <!--DataSource--><br />    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"><br />      <property name="driverCl
整合ssh框架的具体步骤
一、首先整合hibernate4.2+spring3.2 1.复制spring所需基础包到lib目录下 spring所需包列表: 2.测试spring框架是否能使用 3.复制hibernate4.2所需基础包到lib目录 hibernate所需包列表: 4.在项目src目录下创建spring配置文件applicationContext.xml http://www.spr
SSH整合框架
Struts2+Hibernate3+Spring3+MySql整个框架实现用户登录,用户账单,导出Exce…………更多功能正在开发中,望大家共同探讨。如果下载无法使用全分退还.使用前请阅读说明文档。打开密码为:PanYing 里面是文件下载地址
jBPM4.4与SSH框架的整合
jBPM4.4与SSH框架的整合,流程管理
ssh框架 整合代码
spring 整合struts2 hibernate 源码
SSH框架完全整合
整合了 spring2.5 hibernate3.0,struts2 完全可用,包含了所有的jar包和简单的测试..
SSH框架的整合与开发
适用于新手刚开始学习ssh框架的构成,里面有详细的步骤指导
maven整合ssh框架
这是自己根据别人写的资料,自己搭载的框架,运行没有问题,用的是eclipse_luna(mars与最新的maven我没有弄好,报错),jak1.7,tomcat7.数据库用的是mysql,希望对初学者有用!
maven整合SSH框架
maven整合SSH框架
Maven ssh整合框架
Maven ssh整合框架Maven ssh整合框架Maven ssh整合框架Maven ssh整合框架Maven ssh整合框架
ssh整合框架包
ssh整合的包减肥了的 使我用的最多的整合包 快来下载吧
jbpm 整合 ssh框架
NULL 博文链接:https://qq44056919.iteye.com/blog/643568
ssh整合框架
整合好的ssh框架开发,可以直接使用,进行web项目的开发
SSH整合所需的框架
三大主流框架struts,spring和hibernate整合所需的jar包
SSH框架的整合 (配置)
需要的jar 包 (如果jar包有冲突,保留高级版本的,删除低级版本的) spring + struts 2 配置 web.xml &lt;!-- Struts2的配置 --&gt; &lt;filter&gt; &lt;filter-name&gt;struts2&lt;/filter-name&gt; &lt;filter-class&gt; org.apache....
SSH框架的整合
1、Struts+spring的整合 ·web.xml中  ·加载的spring配置文件   ·&amp;lt;context-param&amp;gt;    &amp;lt;param-name&amp;gt;contextConfigLocation&amp;lt;/param-name&amp;gt;    &amp;lt;param-value&amp;gt;    /WEB-INF/applicationContext*.xml /  classp...
SSH注解整合框架
Struts2+Spring+Hibernate使用注解取代配置文件
自定义SSH整合框架
自定义SSH开发,基于SSH的二次封装扩展。
ssh框架简单整合
学习java时自己做的简单SSH框架整合,部分功能没有实现
ssh框架jar包整合
ssh框架整合jar包,整合好好的jar包资源,分散下载麻烦,直接打包,解压能用,使用jar包自己整合,程序员多练习
extjs整合ssh框架
公司项目原来由 extjs3+ssh+sql server 构成,现将其转至 extjs4+ssh2+sql server平台,尽量将过程记述供自己备忘。 01--MyEclipse搭建extjs4+ssh2 平台构建 02--加入struts2 和 spring 03--spring 配置文件的修改 04--加入extjs4的支持文件 配置tomcat的gzip的压缩 05--配置 web.xml,登录验证过滤器和session监听器
JBPM3.2 整合ssh框架
最近整合了一个jbpm3.2 与ssh框架的Demo,期间遇到了不少问题 ,有的问题比较难搞,但是经过我的努力,还是运行起来了,工作流基本上可以完成流转,不过也存在一些问题,这里我综合起来说一下!当然 有的人说jbpm3已经落伍了,但是我个人不纠结于版本,只要能做出东西来就好。这是我搭建框架所需要的jar包: 其他不说 我说一下jbpm的identity包,我之前用官网的id
SSh框架 整合Axis2
Axis2整合SSH框架
Eclipse 整合SSH框架
在网上找到的一位大佬的整理链接如下:http://blog.csdn.net/napoay/article/details/50310655
Maven项目整合SSH框架
---------------------siwuxie095                               Maven 项目整合 SSH 框架       创建 Maven 项目 maven-ssh,项目目录结构如下:              将 src/main/java 展开如下:
Maven 整合 SSH 框架
前面的一系列文章中,我们总结了三大框架:Struts2,Hibernate,Spring 的基本知识。本篇就姑且尝试着使用 Maven 这个项目构建工具来将这三个框架整合一起。说到这里,如果有对 Maven 还不熟悉的同学,此处推荐下面两个链接快速了解下,记得回来!Maven 是什么? 如何给小白说明 Maven 是什么? 我对 Maven 的理解就是,它是一个工具能提供两大主要功能,其一是依赖管
相关热词 c#异步发送kafka c#窗体编号 c# 操作二进制文件 c# 反射 机制 c#线程 窗体失去响应 c#角度转弧度 c# 解析gps数据 c# vs设置 语法版本 c# json含回车 c#多线程demo