SSH框架save()数据时的问题,求大神帮忙看一下

Resume 和其他三张表一对多关联:
@OneToMany(fetch = FetchType.EAGER,targetEntity=EducationBackground.class,cascade={CascadeType.ALL},orphanRemoval=true)
// @Cascade(value={org.hibernate.annotations.CascadeType.ALL})
// @NotFound(action = NotFoundAction.IGNORE)
@JoinColumn(name="resume_id")
public List getEducationBackground() {
return educationBackground;
}
public void setEducationBackground(List educationBackground) {
this.educationBackground = educationBackground;
}

@OneToMany(targetEntity=WorkExperience.class,fetch = FetchType.EAGER,cascade={CascadeType.ALL},orphanRemoval=true)
@JoinColumn(name="resume_id")
public List<WorkExperience> getWorkExperience() {
    return workExperience;
}
public void setWorkExperience(List<WorkExperience> workExperience) {
    this.workExperience = workExperience;
}

@OneToMany(targetEntity=Skills.class,fetch = FetchType.EAGER,cascade={CascadeType.ALL},orphanRemoval=true)
@JoinColumn(name="resume_id")
public List<Skills> getSkills() {
    return skills;
}
public void setSkills(List<Skills> skills) {
    this.skills = skills;
}

插入数据时,我提交一个请求,结果主表给我添加了两条数据,第二条为空:
第二条数据只有主键有值,其他全为空,再次提交时就报错了:

严重: Exception occurred during processing request: detached entity passed to persist: com.resume.demain.Resume

3个回答

各位大神 帮帮忙,本人初学不是太懂

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "xx") 这是一对多

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "xxx") 这是多对一

qq_34880854
温柔写的伤 多对一的一方必须为延时加载吗?我试了一下 还是不行呢?
大约 4 年之前 回复

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "xx") 这是一对多

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "xxx") 这是多对一

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ssh框架登录报404求大神解答!!!

我的源码: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <description>Spring 配置文件位置</description> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <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> <welcome-file-list> <welcome-file>login.jsp</welcome-file> </welcome-file-list> </web-app> 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" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <!-- 数据源 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="username" value="root" /> <property name="password" value="123456" /> <property name="url" value="jdbc:mysql://localhost:3306/test"></property> </bean> <!-- session factory --> <!-- session factory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop> <prop key="hibernate.show_sql">true</prop> </props> </property> <property name="mappingResources"> <list> <value>com/entity/User.hbm.xml</value> </list> </property> </bean> <!-- 把DAO注入给Session工厂 --> <bean id="UserDao" class="com.dao.UserDao"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <!-- 把Service注入给DAO --> <bean id="LoginService" class="com.service.LoginService"> <property name="userDao"> <ref local="UserDao" /> </property> </bean> <!-- 把Action注入给Service property name对应的是action里面的属性svc--> <bean name="LoginAction" class="com.action.LoginAction"> <property name="svc"> <ref bean="LoginService" /> </property> </bean> </beans> struts.xml配置 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="login" extends="struts-default" namespace="/"> <action name="login" class="LoginAction"> <result name="success">/success.jsp</result> <result name="error">/login.jsp</result> </action> </package> </struts> User.java package com.entity; import java.io.Serializable; public class User implements Serializable { private Integer id; private String username; private String password; public User(){} public User(String username,String password){ this.username=username; this.password=password; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } /** * @return the password */ public String getPassword() { return password; } /** * @param password the password to set */ public void setPassword(String password) { this.password = password; } } User.hbm.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.entity.User" table="info" catalog="test"> <id name="id" type="java.lang.Integer"> <column name="id" /> <generator class="increment"></generator> </id> <property name="username" type="java.lang.String"> <column name="username" length="32" not-null="true" /> </property> <property name="password" type="java.lang.String"> <column name="password" length="32" not-null="true" /> </property> </class> </hibernate-mapping> UserDao.java package com.dao; import java.util.List; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; import com.entity.User; public class UserDao extends HibernateDaoSupport { public void save(User user) { this.getHibernateTemplate().save(user); } public void update(User user) { this.getHibernateTemplate().update(user); } public void delete(User user) { this.getHibernateTemplate().delete(user); } public User getByPk(int pk) { List list = this.getHibernateTemplate().find("from User where id=" + pk); if (list.isEmpty()) { return null; } return (User) list.get(0); } public User getByUserName(String username) { List list = this.getHibernateTemplate().find("from User where username" + username+""); if (list.size()==0) { return null; } return (User) list.get(0); } } LoginService.java package com.service; import com.dao.UserDao; import com.entity.User; public class LoginService { private UserDao userDao; public String login(String username, String password) { User user = userDao.getByUserName(username); if (null != user) { if (password.equals(user.getPassword())) { return "success"; } else { return "密码错误"; } } else { return "用户不存在"; } } public UserDao getUserDao() { return userDao; } public void setUserDao(UserDao userDao) { this.userDao = userDao; } } LoginAction.java package com.action; import com.opensymphony.xwork2.ActionSupport; import com.service.LoginService; public class LoginAction extends ActionSupport { private String username; private String password; private LoginService svc; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public LoginService getSvc() { return svc; } public void setSvc(LoginService svc) { this.svc = svc; } public String execute() { if (null == username || username.equals("")) { return ""; } String info = svc.login(username, password); if (info.equals("success")) { return "success"; } System.out.println(info); return "error"; } } login.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <form action="LoginAction" method="post"> 用户:<input type="text" name="username"><br> 密码:<input type="password" name="password"><br> <input type="submit" value="登录"><br> </form> </body> </html> success.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@taglib prefix="s" uri="/struts-tags" %> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>登录成功页面</title> </head> <body> <h1>登录成功!</h1> </body> </html>

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

SSH整合框架中save方法执行的时候会删除原有数据 如: Hibernate: delete from stu_tea where tea_id=? Hibernate: insert into stu_tea (tea_id, stu_id) values (?, ?) 我用的实体类注解方式,多对多关联关系,学生和老师类,执行save的时候每次中间表的关联关系都会被新的关联关系覆盖,看sql语句输出是现实先把原来的删除了,再添加的,检查过自己的配置<prop key="hibernate.hbm2ddl.auto">update</prop>这个确定是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> ```

ssh框架update()无法获取数据

调试了很久的BUG都解决不了求各位大神解答一下谢谢了 UpdateAction.java public class UpdateAction extends ActionSupport { private String userName; private String userPwd; private String userRname; private String userEmail; private String userCompany; private String userTel; private String userFax; private IEpUserService epUserService; public UpdateAction() { } public UpdateAction(String userName, String userPwd, String userRname, String userEmail, String userCompany, String userTel,String userFax ) { super(); this.userName = userName; this.userPwd = userPwd; this.userRname = userRname; this.userEmail = userEmail; this.userCompany = userCompany; this.userTel = userTel; this.userFax = userFax; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getUserPwd() { return userPwd; } public void setUserPwd(String userPwd) { this.userPwd = userPwd; } public String getUserRname() { return userRname; } public void setUserRname(String userRname) { this.userRname = userRname; } public String getUserEmail() { return userEmail; } public void setUserEmail(String userEmail) { this.userEmail = userEmail; } public String getUserCompany() { return userCompany; } public void setUserCompany(String userCompany) { this.userCompany = userCompany; } public String getUserTel() { return userTel; } public void setUserTel(String userTel) { this.userTel = userTel; } public String getUserFax() { return userFax; } public void setUserFax(String userFax) { this.userFax = userFax; } public IEpUserService getEpUserService() { return epUserService; } public void setEpUserService(IEpUserService epUserService) { this.epUserService = epUserService; } public String execute() { EpUser epUser = new EpUser(userName, userPwd, userRname,userEmail, userCompany,userTel, userFax,null,null); if (epUserService.update(epUser)) return SUCCESS; else return ERROR; } IEpUserDAO.java public interface IEpUserDAO { public void update(EpUser persistentInstance); } EpUserDAO.java public void update(EpUser transientInstance) { log.debug("updating EpUser instance"); try { getHibernateTemplate().getSessionFactory().openSession().update(transientInstance); log.debug("update successful");} catch (RuntimeException re) { log.error("update failed", re); throw re; } } IEpUserService.java public interface IEpUserService { public boolean update(EpUser epUser); } EpUserService.java public class EpUserService implements org.ssh.service.IEpUserService { private IEpUserDAO epUserDao;//要进行注入 public IEpUserDAO getEpUserDao() { return epUserDao; } public void setEpUserDao(IEpUserDAO epUserDao) { this.epUserDao = epUserDao; } public boolean update(EpUser epUser) { epUserDao.update(epUser); return true; } } EpUser.java public EpUser(String userName, String userPwd) { this.userName = userName; this.userPwd = userPwd; } /** full constructor */ public EpUser(String userName, String userPwd, String userRname, String userEmail, String userCompany, String userTel, String userFax, Integer userRight,String userDatetime ) { this.userName = userName; this.userPwd = userPwd; this.userRname = userRname; this.userEmail = userEmail; this.userCompany = userCompany; this.userTel = userTel; this.userFax = userFax; this.userRight = userRight; this.userDatetime = userDatetime; get()和set()省略…… struts.xml <action name="UpdateAction" class="org.ssh.action.UpdateAction"> <result name="success">/user/updateSuccess.jsp</result> <result name="error">/user/editError.jsp</result> </action> 求指点 前面写了个save方法可以写入数据,但是用update显示无法获取数据来修改

SSH框架搭建过程中遇到jsp页面的值无法传到action中的情况,求大神解答

实体类 ``` package ssh.domain; import com.sun.javafx.beans.IDProperty; import javax.persistence.Id; public class Product { private int pid; private String pname; private double price; public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } public String getPname() { return pname; } public void setPname(String pname) { this.pname = pname; } public int getPid() { return pid; } public void setPid(int pid) { this.pid = pid; } } ``` jsp ``` <%@ taglib prefix="s" uri="/struts-tags" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>商品管理</title> </head> <body> <h1>保存商品的页面</h1> <s:form action="product_save" method="POST" namespace="/" theme="simple"> <table border="1" width="400"> <tr> <td>商品名称</td> <td><s:textfield name="pname"/></td> </tr> <tr> <td>商品价格</td> <td><s:textfield name="price"/></td> </tr> <tr> <td colspan="2"><input type="submit" value="添加"/> </td> </tr> </table> </s:form> </body> </html> ``` 映射文件 ``` <?xml version="1.0" encoding="UTF-8"?> <!--<!DOCTYPE hibernate-mapping PUBLIC--> <!--"-//Hibernate/Hibernate Mapping DTD 3.0//EN"--> <!--"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">--> <hibernate-mapping> <class name="ssh.domain.Product" table="product"> <id name="pid" column="pid"> <generator class="native"/> </id> <property name="pname" column="pname" length="20"/> <property name="price" column="price"/> </class> </hibernate-mapping> ``` action方法 ``` package ssh.action; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ModelDriven; import ssh.domain.Product; import ssh.service.ProductService; public class ProductAction extends ActionSupport implements ModelDriven<Product> { private Product product=new Product(); @Override public Product getModel() { return product; } private ProductService productService; public void setProductService(ProductService productService) { this.productService = productService; } public void save(){ System.out.println("Action中的save方法执行了..."); productService.save(product); } } ``` struts.xml ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN" "http://struts.apache.org/dtds/struts-2.5.dtd"> <struts> <package name="ssh" extends="struts-default" namespace="/"> <action name="product_*" class="productAction" method="{1}"> </action> </package> </struts> ``` 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:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> <!--引入外部属性文件--> <context:property-placeholder location="classpath:/jdbc.properties"/> <!--配置出出c3p0连接池--> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driverClass" value="${jdbc.driverClass}"/> <property name="jdbcUrl" value="${jdbc.url}"/> <property name="user" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> </bean> <!--配置hibernate的相关属性--> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <!--注入连接池--> <property name="dataSource" ref="dataSource"/> <!--配置hibernate属性--> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">true</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> </props> </property> <!--加载映射文件--> <property name="mappingResources"> <list> <value>ssh/domain/Product.hbm.xml</value> </list> </property> </bean> <bean id="productDao" class="ssh.dao.ProductDao"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="productService" class="ssh.service.ProductService"> <property name="productDao" ref="productDao"/> </bean> <bean id="productAction" class="ssh.action.ProductAction" scope="prototype"> <property name="productService" ref="productService"/> </bean> </beans> ``` 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"> <!--spring核心监听器--> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <!--struts2核心过滤器配置--> <filter> <filter-name>struts</filter-name> <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> ``` action获取不到jsp传入的pname,price值,而且我在网页的开发者模式下看的时候name值为null,如下图,看不出写的有什么问题,求大神解答 ![图片说明](https://img-ask.csdn.net/upload/201905/15/1557910262_969296.png) 并且运行到dao中的this.getHibernateTemplate().save(product);方法时报下面错误 ``` HTTP Status 500 - No value for key [org.hibernate.internal.SessionFactoryImpl@4483c105] bound to thread [http-apr-8080-exec-5] type Exception report message No value for key [org.hibernate.internal.SessionFactoryImpl@4483c105] bound to thread [http-apr-8080-exec-5] description The server encountered an internal error that prevented it from fulfilling this request. exception java.lang.IllegalStateException: No value for key [org.hibernate.internal.SessionFactoryImpl@4483c105] bound to thread [http-apr-8080-exec-5] org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:210) org.springframework.orm.hibernate5.HibernateTransactionManager.doCleanupAfterCompletion(HibernateTransactionManager.java:649) org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:1021) org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:887) org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:834) org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:536) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:286) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671) ssh.service.ProductService$$EnhancerBySpringCGLIB$$5317e513.save(<generated>) ssh.action.ProductAction.save(ProductAction.java:31) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:899) ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1544) ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:98) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:90) ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1620) 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:374) com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:426) com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:372) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:438) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:293) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:250) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:179) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:49) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:142) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:137) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:137) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:201) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:67) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:133) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:85) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:101) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:142) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:160) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:175) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:121) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:167) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:203) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:196) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:48) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:574) org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79) org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141) ```

SSH框架报错找不到action,求大神指教

我是用 ``` <a class="more" href="/stage/charge/ordershow.action"> ``` 跳转,但是报There is no Action mapped for action name ordershow.错,新手求指教 错误: ``` 六月 06, 2016 11:32:02 上午 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 警告: Could not find action or result There is no Action mapped for action name ordershow. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189) at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:475) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) ``` strust.xml配置: ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <constant name="struts.devModel" value="true" /> <include file="json-default.xml" /> <include file="struts-default.xml" /> <package name="login" extends="json-default"> <action name="ordershow" class="orderAction" method="show"> <result name="show">/stage/order/order_info.jsp</result> </action> </package> <constant name="struts.i18n.encoding" value="UTF-8" /> <constant name="struts.locale" value="zh_CN" /> <constant name="struts.ui.theme" value="simple" /> <constant name="struts.ui.templateDir" value="template" /> <constant name="struts.ui.templateSuffix" value="ftl" /> </struts> ``` web.xml: ``` <?xml version="1.0" encoding="UTF-8" ?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <display-name></display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <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> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:/spring-*.xml </param-value> </context-param> </web-app> ``` jsp: ``` <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ taglib uri="/struts-tags" prefix="s"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %> <!DOCTYPE html> <!--[if IE 8]> <html lang="en" class="ie8"> <![endif]--> <!--[if IE 9]> <html lang="en" class="ie9"> <![endif]--> <!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> <!-- BEGIN HEAD --> <head> <meta charset="utf-8" /> <title>Ttuo-Hotel | 酒店管理系统</title> <meta content="width=device-width, initial-scale=1.0" name="viewport" /> <meta content="" name="description" /> <meta content="" name="author" /> <link href="../assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" /> <link href="../assets/css/metro.css" rel="stylesheet" /> <link href="../assets/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" /> <link href="../assets/font-awesome/css/font-awesome.css" rel="stylesheet" /> <link href="../assets/fullcalendar/fullcalendar/bootstrap-fullcalendar.css" rel="stylesheet" /> <link href="../assets/css/main_style.css" rel="stylesheet" /> <link href="../assets/css/style_responsive.css" rel="stylesheet" /> <link href="../assets/css/style_default.css" rel="stylesheet" id="style_color" /> <link rel="stylesheet" type="text/css" href="../assets/chosen-bootstrap/chosen/chosen.css" /> <link rel="stylesheet" type="text/css" href="../assets/uniform/css/uniform.default.css" /> <link rel="shortcut icon" href="../favicon.ico" /> </head> <!-- END HEAD --> <!-- BEGIN BODY --> <body class="fixed-top"> <!-- BEGIN HEADER --> <div class="header navbar navbar-inverse navbar-fixed-top"> <!-- BEGIN TOP NAVIGATION BAR --> <div class="navbar-inner"> <div class="container-fluid"> <!-- BEGIN LOGO --> <a class="brand" href="index.html"> <img src="../assets/img/logo11.png" alt="logo" /> </a> <!-- END LOGO --> <!-- BEGIN RESPONSIVE MENU TOGGLER --> <a href="javascript:;" class="btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse"> <img src="../assets/img/menu-toggler.png" alt="" /> </a> <!-- END RESPONSIVE MENU TOGGLER --> <!-- BEGIN TOP NAVIGATION MENU --> <ul class="nav pull-right"> <!-- BEGIN NOTIFICATION DROPDOWN --> <li class="dropdown" id="header_notification_bar"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-warning-sign"></i> <span class="badge">6</span> </a> <ul class="dropdown-menu extended notification"> <li> <p>You have 14 new notifications</p> </li> <li><a href="javascript:;" onclick=App.onNotificationClick(1);> <span class="label label-success"><i class="icon-plus"></i> </span> New user registered. <span class="time">Just now</span> </a> </li> <li><a href="#"> <span class="label label-important"><i class="icon-bolt"></i> </span> Server #12 overloaded. <span class="time">15 mins</span> </a> </li> <li><a href="#"> <span class="label label-warning"><i class="icon-bell"></i> </span> Server #2 not respoding. <span class="time">22 mins</span> </a> </li> <li><a href="#"> <span class="label label-info"><i class="icon-bullhorn"></i> </span> Application error. <span class="time">40 mins</span> </a> </li> <li><a href="#"> <span class="label label-important"><i class="icon-bolt"></i> </span> Database overloaded 68%. <span class="time">2 hrs</span> </a> </li> <li><a href="#"> <span class="label label-important"><i class="icon-bolt"></i> </span> 2 user IP blocked. <span class="time">5 hrs</span> </a> </li> <li class="external"><a href="#">See all notifications <i class="m-icon-swapright"></i> </a> </li> </ul> </li> <!-- END NOTIFICATION DROPDOWN --> <!-- BEGIN INBOX DROPDOWN --> <li class="dropdown" id="header_inbox_bar"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-envelope-alt"></i> <span class="badge">5</span> </a> <ul class="dropdown-menu extended inbox"> <li> <p>You have 12 new messages</p> </li> <li><a href="#"> <span class="photo"><img src="../assets/img/avatar2.jpg" alt="" /> </span> <span class="subject"> <span class="from">Lisa Wong</span> <span class="time">Just Now</span> </span> <span class="message"> Vivamus sed auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> <li><a href="#"> <span class="photo"><img src="../assets/img/avatar3.jpg" alt="" /> </span> <span class="subject"> <span class="from">Richard Doe</span> <span class="time">16 mins</span> </span> <span class="message"> Vivamus sed congue nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> <li><a href="#"> <span class="photo"><img src="../assets/img/avatar1.jpg" alt="" /> </span> <span class="subject"> <span class="from"></span> <span class="time">2 hrs</span> </span> <span class="message"> Vivamus sed nibh auctor nibh congue nibh. auctor nibh auctor nibh... </span> </a> </li> <li class="external"><a href="#">See all messages <i class="m-icon-swapright"></i> </a> </li> </ul> </li> <!-- END INBOX DROPDOWN --> <!-- BEGIN TODO DROPDOWN --> <li class="dropdown" id="header_task_bar"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-tasks"></i> <span class="badge">5</span> </a> <ul class="dropdown-menu extended tasks"> <li> <p>You have 12 pending tasks</p> </li> <li><a href="#"> <span class="task"> <span class="desc">New release v1.2</span> <span class="percent">30%</span> </span> <span class="progress progress-success "> <span style="width: 30%;" class="bar"></span> </span> </a> </li> <li><a href="#"> <span class="task"> <span class="desc">Application deployment</span> <span class="percent">65%</span> </span> <span class="progress progress-danger progress-striped active"> <span style="width: 65%;" class="bar"></span> </span> </a> </li> <li><a href="#"> <span class="task"> <span class="desc">Mobile app release</span> <span class="percent">98%</span> </span> <span class="progress progress-success"> <span style="width: 98%;" class="bar"></span> </span> </a> </li> <li><a href="#"> <span class="task"> <span class="desc">Database migration</span> <span class="percent">10%</span> </span> <span class="progress progress-warning progress-striped"> <span style="width: 10%;" class="bar"></span> </span> </a> </li> <li><a href="#"> <span class="task"> <span class="desc">Web server upgrade</span> <span class="percent">58%</span> </span> <span class="progress progress-info"> <span style="width: 58%;" class="bar"></span> </span> </a> </li> <li><a href="#"> <span class="task"> <span class="desc">Mobile development</span> <span class="percent">85%</span> </span> <span class="progress progress-success"> <span style="width: 85%;" class="bar"></span> </span> </a> </li> <li class="external"><a href="#">See all tasks <i class="m-icon-swapright"></i> </a> </li> </ul> </li> <!-- END TODO DROPDOWN --> <!-- BEGIN USER LOGIN DROPDOWN --> <li class="dropdown user"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> <img alt="" src="../assets/img/avatar1_small.jpg" /> <span class="username"></span> <i class="icon-angle-down"></i> </a> <ul class="dropdown-menu"> <li><a href="extra_profile.html"><i class="icon-user"></i> 我的信息</a> </li> <li><a href="calendar.html"><i class="icon-calendar"></i> 我的日历</a> </li> <li><a href="#"><i class="icon-tasks"></i> 我的任务</a> </li> <li class="divider"></li> <li><a href="hotel.jsp"><i class="icon-key"></i> 退出登录</a> </li> </ul> </li> <!-- END USER LOGIN DROPDOWN --> </ul> <!-- END TOP NAVIGATION MENU --> </div> </div> <!-- END TOP NAVIGATION BAR --> </div> <!-- END HEADER --> <!-- BEGIN CONTAINER --> <div class="page-container row-fluid"> <!-- BEGIN SIDEBAR --> <div class="page-sidebar nav-collapse collapse"> <!-- BEGIN SIDEBAR MENU --> <ul> <li> <!-- BEGIN SIDEBAR TOGGLER BUTTON --> <div class="sidebar-toggler hidden-phone"></div> <!-- BEGIN SIDEBAR TOGGLER BUTTON --> </li> <li> <!-- BEGIN RESPONSIVE QUICK SEARCH FORM --> <form class="sidebar-search"> <div class="input-box"> <a href="javascript:;" class="remove"></a> <input type="text" placeholder="查询. . ." /> <input type="button" class="submit" value=" " /> </div> </form> <!-- END RESPONSIVE QUICK SEARCH FORM --> </li> <li class="has-sub "> <a href="/hotel/index.jsp"> <i class="icon-home"></i> <span class="title">首页</span> <span class="selected"></span> </a> </li> <li class="start active"> <a href="/hotel/stage/stage.jsp"> <i class="icon-bookmark-empty"></i> <span class="title">前台</span> <span class="arrow "></span> </a> <ul class="sub"> <li><a href="/hotel/stage/charge/charge_info.jsp">入住开单</a></li> <li><a href="/hotel/jie">入住详情</a></li> <li><a href="ordershow.action">预定开单</a></li> <li><a href="/hotel/orderfood/food!food.action">订餐服务</a></li> <li><a href="Vip.action">会员管理</a></li> </ul> </li> <li class="has-sub "> <a href="/hotel/restaurant/catering.jsp"> <i class="icon-th-list"></i> <span class="title">餐饮部</span> <span class="arrow "></span> </a> <ul class="sub"> <li><a href="/hotel/restaurant/basic/basic.jsp">餐饮信息</a> </li> <li><a href="/hotel/restaurant/enter/enter!show.action">采购入库</a> </li> <li><a href="/hotel/restaurant/stock/stock.jsp">库存盘点</a> </li> <li><a href="/hotel/restaurant/purchase/purchase!show.action">取材出库</a> </li> </ul> </li> <li class="has-sub "> <a href="/hotel/room/room.jsp"> <i class="icon-star-empty"></i> <span class="title">客房部</span> <span class="arrow "></span> </a> <ul class="sub"> <li><a href="/hotel/room/basic/basic.jsp">基本设置</a> </li> <li><a href="/hotel/room/roommanage/roommanage.jsp">客房管理</a> </li> <li><a href="/hotel/room/damage/damage!show.action">损坏设备统计</a> </li> </ul> </li> <li class="has-sub "> <a href="javascript:;"> <i class="icon-table"></i> <span class="title">统计</span> <span class="arrow "></span> </a> <ul class="sub"> <li ><a href="statistic/room_pie.jsp">房间总体情况</a></li> <li ><a href="statistic/room_stack.jsp">各类型房间情况</a></li> </ul> </li> <li class="has-sub "> <a href="javascript:;"> <i class="icon-briefcase"></i> <span class="title">部门档案</span> <span class="arrow "></span> </a> <ul class="sub"> <li ><a href="department/deptc!show.action">部门分类</a></li> <li ><a href="department/dept!show.action">部门信息</a></li> <li ><a href="department/staff!show.action">人员档案</a></li> </ul> </li> <li class="has-sub "> <a href="javascript:;"> <i class="icon-map-marker"></i> <span class="title">地图</span> <span class="arrow "></span> </a> <ul class="sub"> <li><a></a></li> </ul> </li> <li class="has-sub "> <a href="javascript:;"> <i class="icon-map-marker"></i> <span class="title">公告</span> <span class="arrow "></span> </a> <ul class="sub"> <li><a></a></li> </ul> </li> <li class="has-sub "> <a href="javascript:;"> <i class="icon-briefcase"></i> <span class="title">其他</span> <span class="arrow "></span> </a> <ul class="sub"> <li><a href="profile/profile.jsp">我的信息</a></li> <li><a href="profile/calendar.jsp">我的日程</a></li> <li><a>我的任务</a></li> </ul> </li> <li class=""> <a href="hotel.jsp"> <i class="icon-user"></i> <span class="title">退出登陆</span> </a> </li> </ul> <!-- END SIDEBAR MENU --> </div> <!-- END SIDEBAR --> <div class="page-content"> <!-- BEGIN PAGE CONTAINER--> <div class="container-fluid"> <!-- BEGIN PAGE HEADER--> <div class="row-fluid"> <div class="span12"> <!-- BEGIN STYLE CUSTOMIZER --> <div class="color-panel hidden-phone"> <div class="color-mode-icons icon-color"></div> <div class="color-mode-icons icon-color-close"></div> <br> <div class="color-mode"> <p>主题 颜色</p> <ul class="inline"> <li class="color-black current color-default" data-style="default"></li> <li class="color-blue" data-style="blue"></li> <li class="color-brown" data-style="brown"></li> <li class="color-purple" data-style="purple"></li> <li class="color-white color-light" data-style="light"></li> </ul> <label class="hidden-phone"> <input type="checkbox" class="header" checked value="" /> <span class="color-mode-label">固定标题</span> </label> </div> </div> <!-- END BEGIN STYLE CUSTOMIZER --> <!-- BEGIN PAGE TITLE & BREADCRUMB--> <h3 class="page-title"> 前台<small>请选择内容进行操作:</small> </h3> <ul class="breadcrumb"> <li><i class="icon-home"></i> <a href="/hotel/index.jsp">首页</a> <i class="icon-angle-right"></i> </li> <li><a href="javascript:;">前台</a> </li> </ul> <!-- END PAGE TITLE & BREADCRUMB--> </div> </div> <!-- END PAGE HEADER--> <!-- BEGIN PAGE CONTENT--> <div class="row-fluid"> <div class="span12"> <div id="dashboard"> <!-- BEGIN DASHBOARD STATS --> <div class="row-fluid"> <div class="span2 responsive" data-tablet="span6" data-desktop="span2"> <div class="dashboard-stat yellow"> <div class="visual"> <img src="../assets/img/icon/resize_png_new4.png"> </div> <div class="details"> <div class="number">入住开单</div> <div class="desc"></div> </div> <a class="more" href="/hotel/stage/charge/charge_info.jsp"> 点击浏览更多 <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> <div class="span2 responsive" data-tablet="span6" data-desktop="span2"> <div class="dashboard-stat green"> <div class="visual"> <img src="../assets/img/icon/33216.png"> </div> <div class="details"> <div class="number">入住详情</div> <div class="desc"></div> </div> <a class="more" href="/hotel/jie"> 点击浏览更多 <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> <div class="span2 responsive" data-tablet="span6 fix-offset" data-desktop="span2"> <div class="dashboard-stat purple"> <div class="visual"> <img src="../assets/img/icon/resize_png_new7.png"> </div> <div class="details"> <div class="number">预定开单</div> <div class="desc"></div> </div> <a class="more" href="/stage/charge/ordershow.action"> 点击浏览更多 <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> <div class="span2 responsive" data-tablet="span6 fix-offset" data-desktop="span2"> <div class="dashboard-stat green"> <div class="visual"> <img src="../assets/img/icon/548346.png"> </div> <div class="details"> <div class="number">订餐服务</div> <div class="desc"></div> </div> <a class="more" href="/hotel/orderfood/food!food.action"> 点击浏览更多 <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> <div class="span2 responsive" data-tablet="span6 fix-offset" data-desktop="span2"> <div class="dashboard-stat yellow"> <div class="visual"> <img src="../assets/img/icon/resize_png_new6.png"> </div> <div class="details"> <div class="number">会员管理</div> <div class="desc"></div> </div> <a class="more" href="Vip.action"> 点击浏览更多 <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> </div> </div> <!-- END DASHBOARD STATS --> </div> </div> </div> <!-- END PAGE CONTENT--> </div> <!-- END PAGE CONTAINER--> </div> <!-- END PAGE --> <!-- BEGIN FOOTER --> <div class="footer"> 2014 &copy; Ttuo-Hotel | by ToTeam <div class="span pull-right"> <span class="go-top"><i class="icon-angle-up"></i> </span> </div> </div> <!-- END FOOTER --> <!-- BEGIN JAVASCRIPTS --> <!-- Load javascripts at bottom, this will reduce page load time --> <script src="../assets/js/jquery-1.8.3.min.js"></script> <script src="../assets/breakpoints/breakpoints.js"></script> <script src="../assets/jquery-slimscroll/jquery-ui-1.9.2.custom.min.js"></script> <script src="../assets/bootstrap/js/bootstrap.min.js"></script> <script src="../assets/js/jquery.blockui.js"></script> <script src="../assets/js/jquery.cookie.js"></script> <script src="../assets/fullcalendar/fullcalendar/fullcalendar.min.js"></script> <script type="text/javascript" src="../assets/uniform/jquery.uniform.min.js"></script> <script type="text/javascript" src="../assets/chosen-bootstrap/chosen/chosen.jquery.min.js"></script> <!-- ie8 fixes --> <!--[if lt IE 9]> <script src="assets/js/excanvas.js"></script> <script src="assets/js/respond.js"></script> <![endif]--> <script src="../assets/js/app.js"></script> <script> jQuery(document).ready(function() { // initiate layout and plugins App.setPage('calendar'); App.init(); }); </script> <!-- END JAVASCRIPTS --> </body> <!-- END BODY --> </html> ``` ``` ``` java文件: ``` package com.hotel.action.stage; import java.util.ArrayList; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import com.hotel.entity.stage.Orderlist; import com.hotel.entity.stage.RoomAll; import com.hotel.service.stage.OrderService; import com.hotel.utils.Encode; import com.opensymphony.xwork2.ActionSupport; @Controller("orderAction") @Scope("prototype") public class OrderAction extends ActionSupport { @Autowired @Qualifier("orderService") private OrderService os; private Orderlist orderlist = new Orderlist(); private ArrayList<Orderlist> list1 = new ArrayList<Orderlist>(); ArrayList<RoomAll> list2 = new ArrayList<RoomAll>(); private String idds; private int id; private String number; public String save() { orderlist.setName(Encode.toutf8(orderlist.getName())); os.save(orderlist, idds); return "order1"; } public String show() { list1 = os.show(); return "show"; } public String getone() { list2 = os.getone(number); return "get1"; } public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } public int getId() { return id; } public void setId(int id) { this.id = id; } public Orderlist getOrderlist() { return orderlist; } public ArrayList<Orderlist> getList1() { return list1; } public void setList1(ArrayList<Orderlist> list1) { this.list1 = list1; } public void setOrderlist(Orderlist orderlist) { this.orderlist = orderlist; } public String getIdds() { return idds; } public void setIdds(String idds) { this.idds = idds; } public ArrayList<RoomAll> getList2() { return list2; } public void setList2(ArrayList<RoomAll> list2) { this.list2 = list2; } } ``` 程序结构: ![图片说明](https://img-ask.csdn.net/upload/201606/06/1465185272_322367.png) jsp文件位置: ![图片说明](https://img-ask.csdn.net/upload/201606/06/1465185442_652255.png) jar包: ![图片说明](https://img-ask.csdn.net/upload/201606/06/1465185533_60648.png) ![图片说明](https://img-ask.csdn.net/upload/201606/06/1465185546_855720.png)

SSH框架整合中读取不到Spring的配置文件

求大神指导 下面附上源码: 错误提示: 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: entity class not found: po.BizClaimVoucherDetail at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1486) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.hibernate.MappingException: entity class not found: po.BizClaimVoucherDetail at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:125) at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:191) at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:67) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:135) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:485) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:133) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:286) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:863) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:782) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483) ... 21 more Caused by: java.lang.ClassNotFoundException: po.BizClaimVoucherDetail at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192) at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:122) ... 34 more Spring配置文件的位置在SRC下创建了一个resource的文件夹 applicationContext.xml的配置文件源码: <!-- 创建sessionfactory回话工厂的bean 并读取Hibernate.cfg.xml的配置文件 --> <bean id = "sessionFactory" class = "org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name = "configLocation" value="classpath:Hibernate.cfg.xml"></property> </bean> <!-- 实体类的bean 依赖注入--> <bean id="bizCheckResult" class="com.bdqn.zzt.jboa.entity.BizCheckResult"></bean> <bean id="bizClaimVoucher" class="com.bdqn.zzt.jboa.entity.BizClaimVoucher"></bean> <bean id="bizClaimVoucherDetail" class="com.bdqn.zzt.jboa.entity.BizClaimVoucherDetail"></bean> <bean id="sysDepartment" class="com.bdqn.zzt.jboa.entity.SysDepartment"></bean> <bean id="sysEmployee" class="com.bdqn.zzt.jboa.entity.SysEmployee"></bean> <bean id="sysPosition" class="com.bdqn.zzt.jboa.entity.SysPosition"></bean> <!--数据层的bean 依赖注入 --> <bean id = "userDaoImpl" class = "com.bdqn.zzt.jboa.dao.UserDaoImpl"> <property name = "sessionFactory" ref = "sessionFactory"></property> </bean> <!--业务层的bean 依赖注入 --> <bean id = "userBizImpl" class = "com.bdqn.zzt.jboa.biz.UserBizImpl"> <property name = "userDao" ref = "userDaoImpl"></property> </bean> <!-- 事务的管理 --> <bean id = "transactionManager" class = "org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name = "sessionFactory" ref = "sessionFactory"></property> </bean> <tx:advice id = "txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name = "get*" read-only="false"></tx:method> <tx:method name = "find*" ></tx:method> <tx:method name = "add*" ></tx:method> <tx:method name = "save*" ></tx:method> <tx:method name = "update*" ></tx:method> <tx:method name = "delete*" ></tx:method> <tx:method name = "merge" ></tx:method> </tx:attributes> </tx:advice> <aop:config> <aop:pointcut id = "serviceMethod" expression="execution(public * com.bdqn.zzt.jboa.biz.*.*(..))"></aop:pointcut> <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceMethod"></aop:advisor> </aop:config> Web.xml的源码: <!--Spring 配置文件的存放位置 --> <!-- <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <!-- Spring 的监听器 WEB环境中启动Spring容器 --> <!-- <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> --> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <!-- OpenSessionInView过滤器的配置 使回sesstion的管理范围增加--> <!-- <filter> <filter-name>OpenSessionInViewFilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> </filter> <filter-mapping> <filter-name>OpenSessionInViewFilter</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> --> <filter> <filter-name>openSessionInViewFilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> <init-param> <param-name>sessionFactoryBeanName</param-name> <param-value>sessionFactory</param-value> </init-param> </filter> <filter-mapping> <filter-name>openSessionInViewFilter</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <!--Strurs2的核心过滤器配置 --> <!-- <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> --> <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>

SSH框架的Action找不到错误,一脸懵逼,求各位大神!!

报错信息为: ERROR DefaultDispatcherErrorHandler Exception occurred during processing request: Unable to instantiate Action, productAction, defined for 'Product_save' in namespace '/product'productAction Unable to instantiate Action, productAction, defined for 'Product_save' in namespace '/product'productAction - action - file:/D:/apache-tomcat-9.0.11/wtpwebapps/SSH2/WEB-INF/classes/struts.xml:11:68 at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:320) at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:401) at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:201) at org.apache.struts2.factory.StrutsActionProxy.prepare(StrutsActionProxy.java:57) at org.apache.struts2.factory.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:32) at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:60) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564) at org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79) at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:844) Caused by: java.lang.ClassNotFoundException: productAction at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1309) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1138) at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:179) at com.opensymphony.xwork2.ObjectFactory.getClassInstance(ObjectFactory.java:129) at com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:252) at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:168) at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:177) at com.opensymphony.xwork2.factory.DefaultActionFactory.buildAction(DefaultActionFactory.java:40) at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:142) at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:301) ... 27 more 代码截图如下: 这是Action代码 ![图片说明](https://img-ask.csdn.net/upload/201811/07/1541559869_299114.png) struts.xml代码 ![图片说明](https://img-ask.csdn.net/upload/201811/07/1541559944_394621.png) index.jsp代码: ![图片说明](https://img-ask.csdn.net/upload/201811/07/1541559999_437720.png) 还有applicationContext.xml代码 ![图片说明](https://img-ask.csdn.net/upload/201811/07/1541560081_738865.png)

SSH中Struts2获取不到jsp页面中值,求大神指点

ssh框架整合,添加员工信息; 员工,Emp: ``` package com.blue.entity; public class Emp { //id,数据库中为标识列 private int empId; //姓名 private String empName; //年龄 private int empAge; //性别 private String empSex; public int getEmpId() { return empId; } public void setEmpId(int empId) { this.empId = empId; } public String getEmpName() { return empName; } public void setEmpName(String empName) { this.empName = empName; } public int getEmpAge() { return empAge; } public void setEmpAge(int empAge) { this.empAge = empAge; } public String getEmpSex() { return empSex; } public void setEmpSex(String empSex) { this.empSex = empSex; } } ``` jsp页面,form: ``` <form action="empLogin" method="post"> <table width="300px" height="150px" border="1px"> <tr> <td width="100px">姓名:</td> <td><input type="text" name="emp.empName"/></td> </tr> <tr> <td>年龄:</td> <td><input type="text" name="emp.empAge"/></td> </tr> <tr> <td>性别:</td> <td><input type="text" name="emp.empSex"/></td> </tr> <tr> <td colspan="2"><input type="submit" value="保存"></td> </tr> </table> </form> ``` action: ``` package com.blue.action; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.blue.entity.Emp; import com.blue.service.EmpService; import com.opensymphony.xwork2.ActionSupport; public class EmpAction extends ActionSupport{ public String result(){ ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml"); EmpService empService= (EmpService) context.getBean("empService"); Emp emp = (Emp) context.getBean("emp"); //测试 System.out.println("id:"+emp.getEmpId()+" name:"+emp.getEmpName()+" age:"+emp.getEmpAge()+" sex:"+emp.getEmpSex()); int num = empService.save(emp); if(num == -1){ //值为空 return "empty"; }else if(num > 0){ //添加成功 return SUCCESS; }else{ //失败 return ERROR; } } } 控制台输出: id:0 name:null age:0 sex:null ``` spring配置文件(beans.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" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd"> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="configLocation"> <value> classpath:hibernate.cfg.xml </value> </property> </bean> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <bean id="emp" class="com.blue.entity.Emp"></bean> <bean id="empDao" class="com.blue.dao.impl.EmpDaoImpl"> <property name="hibernateTemplate" ref="hibernateTemplate"></property> </bean> <bean id="empService" class="com.blue.service.impl.EmpServiceImpl"> <property name="empDao" ref="empDao"></property> </bean> <bean id="empAction" class="com.blue.action.EmpAction" scope="prototype"></bean> </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.objectFactory" value="spring"></constant> <package name="default" namespace="/" extends="struts-default"> <action name="empLogin" class="com.blue.action.EmpAction" method="result"> <result name="success">welcome.jsp</result> <result name="error">error.jsp</result> <!-- 空值 --> <result name="empty">empty.jsp</result> </action> </package> </struts> ``` 包结构: ![图片说明](https://img-ask.csdn.net/upload/201610/02/1475398814_503001.png) 取不到页面值,求大神指点

SSH整合:No bean named 'TestService' is defined

最近刚刚开始做SSH三大框架整合,搭建了好几天的开发环境,就卡在了Spring与Hibernate 整合上, ![图片说明](https://img-ask.csdn.net/upload/201505/17/1431793030_317551.png) TestService.java package com.zyf.test; import javax.annotation.Resource; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.stereotype.Controller; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import cn.zyf.pj.domain.User; @Service public class TestService { @Resource private SessionFactory sessionFactory; @Transactional public void saveTwoUsers() { Session session = sessionFactory.getCurrentSession(); session.save(new User()); session.save(new User()); } } TestSpring.java package com.zyf.test; import org.hibernate.SessionFactory; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class TestSpring { private ApplicationContext ac= new ClassPathXmlApplicationContext("applicationContext.xml"); //测试sessionFactory @Test public void testSessionFactory() throws Exception{ SessionFactory sessionFactory =(SessionFactory)ac.getBean("sessionFactory"); System.out.println(sessionFactory.openSession()); } //测试事物 @Test public void testSaveUsers(){ TestService ts=(TestService) ac.getBean("TestService"); ts.saveTwoUsers(); } } Hibernate.cfg.xml <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- 数据连接信息 <property name="hibernate.connection.url">jdbc:mysql:///pj</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password">abc123</property> --> <property name="hibernate.dialect"> org.hibernate.dialect.MySQL5InnoDBDialect </property> <!-- 其他配置信息 --> <property name="show_sql">true</property> <property name="hbm2ddl.auto">update</property> <mapping resource="cn/zyf/pj/domain/User.hbm.xml" /> </session-factory> </hibernate-configuration> 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:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <!-- 自动扫描与装配bean --> <context:component-scan base-package="cn.zyf.pj" annotation-config="true"></context:component-scan> <!-- 导入外部的properties配置文件 --> <context:property-placeholder location="classpath:jdbc.properties"/> <!-- 配置数据库连接池 --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <!-- =========== 数据库连接信息 =========== --> <property name="jdbcUrl" value="${jdbcUrl}"></property> <property name="driverClass" value="${driverClass}"></property> <property name="user" value="${username}"></property> <property name="password" value="${password}"></property> <!-- =========== 连接池的管理配置 =========== --> <!--初始化时获取三个连接,取值应在minPoolSize与maxPoolSize之间。Default: 3 --> <property name="initialPoolSize" value="3"></property> <!--连接池中保留的最小连接数。Default: 3 --> <property name="minPoolSize" value="3"></property> <!--连接池中保留的最大连接数。Default: 15 --> <property name="maxPoolSize" value="5"></property> <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 --> <property name="acquireIncrement" value="3"></property> <!-- 控制数据源内加载的PreparedStatements数量。如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0 --> <property name="maxStatements" value="8"></property> <!--maxStatementsPerConnection定义了连接池内单个连接所拥有的最大缓存statements数。Default: 0 --> <property name="maxStatementsPerConnection" value="5"></property> <!--最大空闲时间,1800秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 --> <property name="maxIdleTime" value="1800"></property> </bean> <!-- 配置SessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"></property> <property name="configLocation" value="classpath:hibernate.cfg.xml"></property> </bean> <!-- 配置声明式的事务管理(采用基于注解的方式) --> <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <tx:annotation-driven transaction-manager="txManager"/> </beans> TestSpring.java package com.zyf.test; import org.hibernate.SessionFactory; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class TestSpring { private ApplicationContext ac= new ClassPathXmlApplicationContext("applicationContext.xml"); //测试sessionFactory @Test public void testSessionFactory() throws Exception{ SessionFactory sessionFactory =(SessionFactory)ac.getBean("sessionFactory"); System.out.println(sessionFactory.openSession()); } //测试事物 @Test public void testSaveUsers(){ TestService ts=(TestService) ac.getBean("TestService"); ts.saveTwoUsers(); } } 对TestSpring进行单元测试,第一个方法正常执行,第二个方法报错No bean named 'TestService' is defined,并且在数据库中自动生成test_users表,困扰了好久了,麻烦大神指点一下!!!!

在表单的table中的每一个单元格加入俩个下拉菜单,求大神指导怎么写,跪求~

在表单的table中的每一个单元格加入俩个下拉菜单,求大神指导怎么写?下面有初步的jsp代码。我用的是SSH框架.有一个下拉菜单的值是动态的,是别的表内的属性。怎么把一个单元格里的两个数据分别确定 ![图片说明](https://img-ask.csdn.net/upload/201508/10/1439190831_496989.png) ``` <%@page contentType="text/html; charset=UTF-8" import="java.util.*" %> <%@ page import="com.sysgrrj.module.ChangFangGouMai.valueobject.ChangFangGouMai" %> <%@ page import="com.sysgrrj.common.TypeChange" %> <%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <jsp:include page='/res/inc/inc.jsp' flush='true'/> </head> <body> <s:form action="List" id="form1" theme="simple"> <jsp:include page='/res/inc/inc_form_List.jsp' flush='true'/> <script type="text/javascript"> function doAction(action) { if (confirm("是否确认保存?")) { document.getElementById("form1").action = "<%=request.getContextPath()%>/Module/ChangFangGouMai/List_save.action"; document.getElementById("form1").submit(); return true; } else { return false; } } </script> <div class="buttonDiv"> <input type="button" class="button_style_save" onclick="doAction('')"/> </div> <div class="validatemsg"> <s:actionerror/> <s:fielderror/> <s:actionmessage/> </div> <% //厂房购买 List<ChangFangGouMai> changFangGouMaiList = (List<ChangFangGouMai>) request.getAttribute("changFangGouMaiList"); %> <table width="100%" class="listext" id="table1"> <tr> <TH colspan="7" style="background: #EBEBEB;height: 35px"> 厂房购买</TH> </tr> <TR> <TH width="30"> 序号</TH> <TH width="80">编号</TH> <TH>1</TH> <TH>2</TH> <TH>3</TH> <TH>4</TH> <%--<TH>trainingOrCompetitionID</TH>--%> </TR> <% int i; int k; int j; String[] s; s=new String[6]; for(j=1;j<7;j++){ String a[]={"第一年","第二年","第三年","第四年","第五年","第六年"}; %> <TR> <TD><%=(j)%> </TD> <TD><%=(a[j-1])%> </TD> <% for(i=1;i<5;i++){ out.print(" <TD>"); String sr= ""; for(k=0;k<changFangGouMaiList.size();k++){ ChangFangGouMai changFangGouMai=changFangGouMaiList.get(k); if(TypeChange.stringToInt(changFangGouMai.getNianDu())==j&&changFangGouMai.getBianHao()==i){ sr=changFangGouMai.getZuYongHuoGouMai(); break; } } out.print("<input type=\"text\" name=\""+j+"_"+i+"\" value=\"" + sr + "\"/>"); out.print("</TD>"); } %> </TR> <% } %> </TABLE> <s:hidden name="TrainingOrCompetitionID"/> </s:form> </body> </html> ```

ssh中 no result defined for action and result error

![图片说明](https://img-ask.csdn.net/upload/201610/24/1477317986_290498.png) ``` <?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> <package name="swork" extends="struts-default" namespace=""> <!-- 全局异常 --> <global-exception-mappings> <!-- result 会取找全局视图的名称 --> <exception-mapping result="null" exception="java.lang.NullPointerException"></exception-mapping> <exception-mapping result="error" exception="java.lang.Exception"></exception-mapping> </global-exception-mappings> <!-- Action实例交给spring容器创建 --> <!-- 招聘信息Action --> <action name="swork_*" class="searchworkAction" method="{1}"> <!-- 招聘列表展示 --> <result name="sworkList">/WEB-INF/list.jsp</result> <result name="error">/WEB-INF/list.jsp</result> <!-- 跳转到添加页面 --> <result name="sworkAdd">/WEB-INF/sworkadd.jsp</result> <!-- 添加成功,进入列表 (防止刷新就多一条记录问题,所以用重定向) --> <result name="sworklistAction" type="redirectAction">swork_list</result> <!-- 进入修改页面 --> <result name="edit">/WEB-INF/sworkedit.jsp</result> </action> </package> </struts> ``` action ``` import java.util.List; import java.util.Map; import org.apache.struts2.interceptor.RequestAware; import com.zx.entity.Searchwork; import com.zx.service.ISearchworkService; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.util.ValueStack; /** * 新闻模块控制器开发: * 1.招聘列表展示 * 2. 添加招聘信息 * 3. 修改招聘信息 * 5. 删除新闻 * @author zhang x * */ public class SearchworkAction extends ActionSupport implements ModelDriven<Searchwork>, RequestAware{ /** * */ private static final long serialVersionUID = 1L; /*******一、封装数据********/ private Searchwork swork = new Searchwork(); // 【模型驱动】 // 封装请求的部门id(下拉列表的实际的值) public void setSearchwork(Searchwork swork) { this.swork = swork; } public Searchwork getSearchwork() { return swork; } public Searchwork getModel() { return swork; // 返回实例化后的对象 } /*******二、注入招聘信息Service********/ private ISearchworkService searchworkService; public void setSearchworkService(ISearchworkService searchworkService) { this.searchworkService = searchworkService; } /** * 1. 招聘信息列表展示 */ public String sworkList() { // 查询所有员工 List<Searchwork> listSwork = searchworkService.getAll(); // 保存到request request.put("listSwork", listSwork); return "sworkList"; } /** * 2. 进入到添加招聘信息页面 */ public String viewAdd(){ return "sworkAdd"; } /** * 2. 添加员工 - 添加招聘信息数据 */ public String save(){ // 调用Service,保存信息 searchworkService.save(swork); return "sworklistAction"; // 重定向到Action } /** * 3. 修改招聘信息 - 进入修改视图 */ public String viewUpdate(){ // 获取要修改的记录的id int id = swork.getId(); // 1. 根据招聘信息的主键查询 (lazy="false") Searchwork swork = searchworkService.findById(id); // 已经有部门信息 // 数据回显 ValueStack vs = ActionContext.getContext().getValueStack(); vs.pop();// 移除栈顶元素 vs.push(swork); // 入栈 return "sworkEdit"; } /** * 4. 修改招聘信息 - 确认修改 */ public String update() { //1. 更新招聘信息 searchworkService.update(swork); return "sworklistAction"; // 重定向到列表 } /** * 5. 修改招聘信息 - 删除 */ public String delete(){ // 获取要删除招聘信息的主键 int sworkId = swork.getId(); // 调用service删除 searchworkService.delete(sworkId); return "sworklistAction"; } // 接收框架运行时候传入的代表request对象的map private Map<String, Object> request; public void setRequest(Map<String, Object> request) { this.request = request; } } ``` ``` %@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@taglib uri="/struts-tags" prefix="s" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>招聘列表展示</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> </head> <body> <div align="center" style="width:80% "> <s:a href="swork_viewAdd">添加招聘信息</s:a> </div> <table border="1" align="center" width="80%" cellpadding="5" cellspacing="0"> <tr> <th>序号</th> <th>工作名称</th> <th>工作地点</th> <th>薪水</th> <th>操作</th> </tr> <s:if test="#request.listSwork != null"> <s:iterator var="swork" value="#request.listSwork" status="st"> <tr> <td> <s:property value="#st.count"/> </td> <td> <s:property value="#swork.id"/> </td> <td> <s:property value="#swork.jobName"/> </td> <td> <s:property value="#swork.workPlace"/> </td> <td> <s:property value="#swork.income"/> </td> <td> <s:a href="swork_viewUpdate?id=%{#swork.id}">修改</s:a> <s:a href="swork_delete?id=%{#swork.id}">删除</s:a> </td> </tr> </s:iterator> </s:if> <s:else> <tr> <td colspan="5">对不起,没有你要找的数据!请先录入。</td> </tr> </s:else> </table> </body> </html> ``` 初学者求大神告知哪里出错,为什么用浏览器打开jsp会报错no result defined for action and result error

web项目在执行大量的插入语句时执行一段时间后卡死

SSH框架,在页面有一个poi 批量导入excel的功能,每读取excel一行,保存为一个实体然后循环insert到DB里。刚开始程序运行正常,但是一段时间过后,系统出现卡死,不再执行insert sql ,刷新页面也没有响应,只能重启服务器。期间程序没有报错,myeclipse也不是内存溢出导致的卡死,因为点击其他功能模块时不会出现上述所说的问题,只有在执行大量的insert sql 时才会。 因为代码没有报错我也就不贴代码了。 我自己想的不知道是不是hibernate在做insert时由于数据量大导致链接关闭,但是我设置数据库连接池断开时间是1800s,事实上也没有超过。由于不知道hibernate底层的源码是怎样执行insert的,希望有大神说说,为什么在执行少量的insert时系统不会卡死,但处理大量数据并长时间insert的就是卡死。 虚心求各位指导!谢谢大家。如果有需要我会贴出代码。感谢。 更改过后的代码,但是又有新的问题 ``` @Override public void save(List<T> list) { long begin = System.currentTimeMillis(); Session session = getSession(); try { for (int i = 0; i < list.size(); i++) { session.save(list.get(i)); if (i%50 == 0 && i != 0) { session.flush(); session.clear(); } } } catch (Exception e) { e.printStackTrace(); } finally{ session.clear(); } long end = System.currentTimeMillis(); System.out.println((end-begin)/1000.0); } ``` 这是basedao,是spring管理hibernate,加了2个属性 ``` <prop key="hibernate.jdbc.fetch_size">100</prop> <prop key="hibernate.jdbc.batch_size">50</prop> ``` 方法是根据不同的实体批量insert,虽然现在执行大量insert时不会中断,但是我有4个实体要连续执行批量insert,在insert完前2个实体后,我在第三个实体调用批量导入的方法设了断点,程序并没有停在断点上,又出现了卡死的情况。PS:不知道是不是在insert第二个实体那里就卡死了,还是说执行完第二个批量insert就卡死了,反正我在第三个批量insert方法前断点没进,并且系统卡死,只能重启。 请大家不吝赐教!感谢!

struts2 [unknown location]

There is no Action mapped for namespace [/] and action name [user-add] associated with context path [/OA]. - [unknown location] com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:192) org.apache.struts2.factory.StrutsActionProxy.prepare(StrutsActionProxy.java:63) org.apache.struts2.factory.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:37) com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:546) org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:81) org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:113) 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:218) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) 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:958) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745) You are seeing this page because development mode is enabled. Development mode, or devMode, enables extra debugging behaviors and reports to assist developers. To disable this mode, set: struts.devMode=false in your WEB-INF/classes/struts.properties file. WEB-INF/classess/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" /> <!-- 把扩展名配置为action结尾 --> <constant name="struts.action.extension" value="action"></constant> <!-- 把主题配置为simple --> <constant name="struts.ui.theme" value="simple"></constant> <!-- 动态调用方法 --> <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <!-- 默认package --> <package name="default" namespace="/" extends="struts-default"> <action name="user-*" class="userAction" method="{1}"> <result name="list">/WEB-INF/jsp/action/list.jsp</result> <result name="editUI">/WEB-INF/jsp/action/edit.jsp</result> <result name="tolist" type="redirectAction">user-list</result> </action> </package> </struts> UserAction.java: package com.ing.oa.action; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import com.opensymphony.xwork2.ActionSupport; @Controller @Scope("prototype") public class UserAction extends ActionSupport { /* 列出所有user */ public String list() { return "list"; } /* 删除user */ public String delete() { return "tolist"; } /* 增加user */ public String add() { return "tolist"; } /* 增加userUI */ public String save() { return "editUI"; } /* 修改user */ public String edit(){ return "tolist"; } /* 修改userUI */ public String editUI() { return "editUI"; } } 问题描述:该环境是SSH框架整合后。执行http://127.0.0.1:8080/OA/user-list.action是可行的,但是把list换成add或edit和editUI即报了上述错误。大神帮忙!求解。

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

实现简单的文件系统

实验内容: 通过对具体的文件存储空间的管理、文件的物理结构、目录结构和文件操作的实现,加深对文件系统内部功能和实现过程的理解。 要求: 1.在内存中开辟一个虚拟磁盘空间作为文件存储器,在其上实现一个简

MIPS单周期CPU-组成原理实验-华中科技大学

使用logisim布线完成的MIPS单周期CPU,可支持28条指令。跑马灯的代码已经装入了寄存器,可以直接开启时钟运行。

2019数学建模A题高压油管的压力控制 省一论文即代码

2019数学建模A题高压油管的压力控制省一完整论文即详细C++和Matlab代码,希望对同学们有所帮助

基于QT和OpenCV的五子棋实现源码

一个简单的五子棋应用,基于QT和OpenCV的实现源码,通过相邻棋子判断是否获胜,不包含人工智能算法,适合新手入门

Git 实用技巧

这几年越来越多的开发团队使用了Git,掌握Git的使用已经越来越重要,已经是一个开发者必备的一项技能;但很多人在刚开始学习Git的时候会遇到很多疑问,比如之前使用过SVN的开发者想不通Git提交代码为什么需要先commit然后再去push,而不是一条命令一次性搞定; 更多的开发者对Git已经入门,不过在遇到一些代码冲突、需要恢复Git代码时候就不知所措,这个时候哪些对 Git掌握得比较好的少数人,就像团队中的神一样,在队友遇到 Git 相关的问题的时候用各种流利的操作来帮助队友于水火。 我去年刚加入新团队,发现一些同事对Git的常规操作没太大问题,但对Git的理解还是比较生疏,比如说分支和分支之间的关联关系、合并代码时候的冲突解决、提交代码前未拉取新代码导致冲突问题的处理等,我在协助处理这些问题的时候也记录各种问题的解决办法,希望整理后通过教程帮助到更多对Git操作进阶的开发者。 本期教程学习方法分为“掌握基础——稳步进阶——熟悉协作”三个层次。从掌握基础的 Git的推送和拉取开始,以案例进行演示,分析每一个步骤的操作方式和原理,从理解Git 工具的操作到学会代码存储结构、演示不同场景下Git遇到问题的不同处理方案。循序渐进让同学们掌握Git工具在团队协作中的整体协作流程。 在教程中会通过大量案例进行分析,案例会模拟在工作中遇到的问题,从最基础的代码提交和拉取、代码冲突解决、代码仓库的数据维护、Git服务端搭建等。为了让同学们容易理解,对Git简单易懂,文章中详细记录了详细的操作步骤,提供大量演示截图和解析。在教程的最后部分,会从提升团队整体效率的角度对Git工具进行讲解,包括规范操作、Gitlab的搭建、钩子事件的应用等。 为了让同学们可以利用碎片化时间来灵活学习,在教程文章中大程度降低了上下文的依赖,让大家可以在工作之余进行学习与实战,并同时掌握里面涉及的Git不常见操作的相关知识,理解Git工具在工作遇到的问题解决思路和方法,相信一定会对大家的前端技能进阶大有帮助。

实用主义学Python(小白也容易上手的Python实用案例)

原价169,限时立减100元! 系统掌握Python核心语法16点,轻松应对工作中80%以上的Python使用场景! 69元=72讲+源码+社群答疑+讲师社群分享会&nbsp; 【哪些人适合学习这门课程?】 1)大学生,平时只学习了Python理论,并未接触Python实战问题; 2)对Python实用技能掌握薄弱的人,自动化、爬虫、数据分析能让你快速提高工作效率; 3)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; 4)想修炼更好的编程内功,优秀的工程师肯定不能只会一门语言,Python语言功能强大、使用高效、简单易学。 【超实用技能】 从零开始 自动生成工作周报 职场升级 豆瓣电影数据爬取 实用案例 奥运冠军数据分析 自动化办公:通过Python自动化分析Excel数据并自动操作Word文档,最终获得一份基于Excel表格的数据分析报告。 豆瓣电影爬虫:通过Python自动爬取豆瓣电影信息并将电影图片保存到本地。 奥运会数据分析实战 简介:通过Python分析120年间奥运会的数据,从不同角度入手分析,从而得出一些有趣的结论。 【超人气老师】 二两 中国人工智能协会高级会员 生成对抗神经网络研究者 《深入浅出生成对抗网络:原理剖析与TensorFlow实现》一书作者 阿里云大学云学院导师 前大型游戏公司后端工程师 【超丰富实用案例】 0)图片背景去除案例 1)自动生成工作周报案例 2)豆瓣电影数据爬取案例 3)奥运会数据分析案例 4)自动处理邮件案例 5)github信息爬取/更新提醒案例 6)B站百大UP信息爬取与分析案例 7)构建自己的论文网站案例

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

C/C++跨平台研发从基础到高阶实战系列套餐

一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

Python界面版学生管理系统

前不久上传了一个控制台版本的学生管理系统,这个是Python界面版学生管理系统,这个是使用pycharm开发的一个有界面的学生管理系统,基本的增删改查,里面又演示视频和完整代码,有需要的伙伴可以自行下

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

linux“开发工具三剑客”速成攻略

工欲善其事,必先利其器。Vim+Git+Makefile是Linux环境下嵌入式开发常用的工具。本专题主要面向初次接触Linux的新手,熟练掌握工作中常用的工具,在以后的学习和工作中提高效率。

JAVA初级工程师面试36问(完结)

第三十一问: 说一下线程中sleep()和wait()区别? 1 . sleep()是让正在执行的线程主动让出CPU,当时间到了,在回到自己的线程让程序运行。但是它并没有释放同步资源锁只是让出。 2.wait()是让当前线程暂时退让出同步资源锁,让其他线程来获取到这个同步资源在调用notify()方法,才会让其解除wait状态,再次参与抢资源。 3. sleep()方法可以在任何地方使用,而wait()只能在同步方法或同步块使用。 ...

java jdk 8 帮助文档 中文 文档 chm 谷歌翻译

JDK1.8 API 中文谷歌翻译版 java帮助文档 JDK API java 帮助文档 谷歌翻译 JDK1.8 API 中文 谷歌翻译版 java帮助文档 Java最新帮助文档 本帮助文档是使用谷

我以为我对Mysql事务很熟,直到我遇到了阿里面试官

太惨了,面试又被吊打

智鼎(附答案).zip

并不是完整题库,但是有智鼎在线2019年9、10、11三个月的试题,有十七套以上题目,普通的网申行测题足以对付,可以在做题时自己总结一些规律,都不是很难

Visual Assist X 破解补丁

vs a's'sixt插件 支持vs2008-vs2019 亲测可以破解,希望可以帮助到大家

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

JavaWEB商城项目(包括数据库)

功能描述:包括用户的登录注册,以及个人资料的修改.商品的分类展示,详情,加入购物车,生成订单,到银行支付等!另外还有收货地址的和我的收藏等常用操作.环境(JDK 1.7 ,mysql 5.5,Ecli

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

一学即懂的计算机视觉(第一季)

图像处理和计算机视觉的课程大家已经看过很多,但总有“听不透”,“用不了”的感觉。课程致力于创建人人都能听的懂的计算机视觉,通过生动、细腻的讲解配合实战演练,让学生真正学懂、用会。 【超实用课程内容】 课程内容分为三篇,包括视觉系统构成,图像处理基础,特征提取与描述,运动跟踪,位姿估计,三维重构等内容。课程理论与实战结合,注重教学内容的可视化和工程实践,为人工智能视觉研发及算法工程师等相关高薪职位就业打下坚实基础。 【课程如何观看?】 PC端:https://edu.csdn.net/course/detail/26281 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,但是大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 下载方式:电脑登录https://edu.csdn.net/course/detail/26281,点击右下方课程资料、代码、课件等打包下载

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

课程主要面向嵌入式Linux初学者、工程师、学生 主要从一下几方面进行讲解: 1.linux学习路线、基本命令、高级命令 2.shell、vi及vim入门讲解 3.软件安装下载、NFS、Samba、FTP等服务器配置及使用

2019 Python开发者日-培训

本次活动将秉承“只讲技术,拒绝空谈”的理念,邀请十余位身处一线的Python技术专家,重点围绕Web开发、自动化运维、数据分析、人工智能等技术模块,分享真实生产环境中使用Python应对IT挑战的真知灼见。此外,针对不同层次的开发者,大会还安排了深度培训实操环节,为开发者们带来更多深度实战的机会。

快速入门Android开发 视频 教程 android studio

这是一门快速入门Android开发课程,顾名思义是让大家能快速入门Android开发。 学完能让你学会如下知识点: Android的发展历程 搭建Java开发环境 搭建Android开发环境 Android Studio基础使用方法 Android Studio创建项目 项目运行到模拟器 项目运行到真实手机 Android中常用控件 排查开发中的错误 Android中请求网络 常用Android开发命令 快速入门Gradle构建系统 项目实战:看美图 常用Android Studio使用技巧 项目签名打包 如何上架市场

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

4小时玩转微信小程序——基础入门与微信支付实战

这是一个门针对零基础学员学习微信小程序开发的视频教学课程。课程采用腾讯官方文档作为教程的唯一技术资料来源。杜绝网络上质量良莠不齐的资料给学员学习带来的障碍。 视频课程按照开发工具的下载、安装、使用、程序结构、视图层、逻辑层、微信小程序等几个部分组织课程,详细讲解整个小程序的开发过程

YOLOv3目标检测实战系列课程

《YOLOv3目标检测实战系列课程》旨在帮助大家掌握YOLOv3目标检测的训练、原理、源码与网络模型改进方法。 本课程的YOLOv3使用原作darknet(c语言编写),在Ubuntu系统上做项目演示。 本系列课程包括三门课: (1)《YOLOv3目标检测实战:训练自己的数据集》 包括:安装darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 (2)《YOLOv3目标检测:原理与源码解析》讲解YOLOv1、YOLOv2、YOLOv3的原理、程序流程并解析各层的源码。 (3)《YOLOv3目标检测:网络模型改进方法》讲解YOLOv3的改进方法,包括改进1:不显示指定类别目标的方法 (增加功能) ;改进2:合并BN层到卷积层 (加快推理速度) ; 改进3:使用GIoU指标和损失函数 (提高检测精度) ;改进4:tiny YOLOv3 (简化网络模型)并介绍 AlexeyAB/darknet项目。

Qt5 局域网通信软件(模仿QQ)

采用Qt5进行开发的局域网通信客户端+Server,界面模仿QQ的界面,聊天界面采用QWidget绘制的气泡!

Python数据清洗实战入门

本次课程主要以真实的电商数据为基础,通过Python详细的介绍了数据分析中的数据清洗阶段各种技巧和方法。

YOLOv3目标检测实战:训练自己的数据集

YOLOv3是一种基于深度学习的端到端实时目标检测方法,以速度快见长。本课程将手把手地教大家使用labelImg标注和使用YOLOv3训练自己的数据集。课程分为三个小项目:足球目标检测(单目标检测)、梅西目标检测(单目标检测)、足球和梅西同时目标检测(两目标检测)。 本课程的YOLOv3使用Darknet,在Ubuntu系统上做项目演示。包括:安装Darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 Darknet是使用C语言实现的轻型开源深度学习框架,依赖少,可移植性好,值得深入探究。 除本课程《YOLOv3目标检测实战:训练自己的数据集》外,本人推出了有关YOLOv3目标检测的系列课程,请持续关注该系列的其它课程视频,包括: 《YOLOv3目标检测实战:交通标志识别》 《YOLOv3目标检测:原理与源码解析》 《YOLOv3目标检测:网络模型改进方法》 敬请关注并选择学习!

Python可以这样学(第一季:Python内功修炼)

董付国系列教材《Python程序设计基础》、《Python程序设计(第2版)》、《Python可以这样学》配套视频,讲解Python 3.5.x和3.6.x语法、内置对象用法、选择与循环以及函数设计与使用、lambda表达式用法、字符串与正则表达式应用、面向对象编程、文本文件与二进制文件操作、目录操作与系统运维、异常处理结构。

ANSI-VITA-46.0-2007(中文翻译版)_V1.0.pdf

ANSI-VITA 46.0 2007老版本的的英文版本的中文翻译版本,含目录,通过谷歌翻译进行文字翻译,翻译的不是很专业,对初学者理解VPX接口及协议有一定的帮助,后续会对翻译进行改进。

相关热词 c#框体中的退出函数 c# 按钮透明背景 c# idl 混编出错 c#在位置0处没有任何行 c# 循环给数组插入数据 c# 多线程死锁的例子 c# 钉钉读取员工排班 c# label 不显示 c#裁剪影像 c#工作进程更新ui
立即提问