我用的是ssh框架,我遇到的问题是,可以新增,可以查询,就是修改时候没有任何效果。没有任何报错信息,我也尝试去try catch抓异常也没有任何信息。之前还是可以修改的。我也不知道为什么突然就这样了
我现在不知道问题出在哪里。求大神给个思路我,应该去哪里找问题。
1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" 4 xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" 5 xsi:schemaLocation="http://www.springframework.org/schema/beans 6 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 7 http://www.springframework.org/schema/aop 8 http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 9 http://www.springframework.org/schema/tx 10 http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> 11 12 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> 13 <property name="driverClassName" value="com.mysql.jdbc.Driver"> 14 </property> 15 <property name="url" value="jdbc:mysql://127.0.0.1:3306/hlzk"></property> 16 <property name="username" value="root"></property> 17 <property name="password" value="root"></property> 18 </bean> 19 <bean id="sessionFactory" 20 class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> 21 <property name="dataSource"> 22 <ref bean="dataSource" /> 23 </property> 24 <property name="hibernateProperties"> 25 <props> 26 <prop key="hibernate.dialect"> 27 org.hibernate.dialect.MySQLDialect 28 </prop> 29 </props> 30 </property> 31 32 <property name="mappingResources"> 33 <list> 34 <value>com/keapop/entity/Team.hbm.xml</value> 35 <value>com/keapop/entity/Nav.hbm.xml</value> 36 <value>com/keapop/entity/Survey.hbm.xml</value> 37 <value>com/keapop/entity/Logininfo.hbm.xml</value> 38 <value>com/keapop/entity/Manager.hbm.xml</value> 39 <value>com/keapop/entity/News.hbm.xml</value> 40 </list> 41 </property> 42 </bean> 65 <!-- dao注入 --> 66 <bean id="ManagerDao" class="com.keapop.dao.impl.ManagerDaoImpl" 67 p:sessionFactory-ref="sessionFactory" /> 68 <bean id="NewsDao" class="com.keapop.dao.impl.NewsDaoImpl" 69 p:sessionFactory-ref="sessionFactory" /> 70 <bean id="SurveyDao" class="com.keapop.dao.impl.SurveyDaoImpl" 71 p:sessionFactory-ref="sessionFactory" /> 72 <!-- biz注入 --> 73 <bean id="ManagerBiz" class="com.keapop.biz.impl.ManagerBizImpl" 74 p:dao-ref="ManagerDao" /> 75 <bean id="NewsBiz" class="com.keapop.biz.impl.NewsBizImpl" 76 p:dao-ref="NewsDao" /> 77 <bean id="SurveyBiz" class="com.keapop.biz.impl.SurveyBizImpl" 78 p:dao-ref="SurveyDao" /> 79 <!-- Action注入 --> 80 <bean id="ManagerAction" class="com.keapop.ui.ManagerAction" 81 p:managerBI-ref="ManagerBiz" scope="prototype" /> 82 <bean id="NewsAction" class="com.keapop.ui.NewsAction" 83 p:newsBI-ref="NewsBiz" scope="prototype"></bean> 84 <bean id="SurveyAction" class="com.keapop.ui.SurveyAction" 85 p:surveyBI-ref="SurveyBiz" scope="prototype"></bean> 86 </beans>
public class ManagerAction extends ActionSupport { private String managerName;//账户名 private String passWord;//密码 private String nickname;//昵称 private boolean disabled;//是否禁用 private short jurisdiction;//操作权限 private int managerId;//账户id ManagerBizImpl managerBI;//spring注入 List<Manager> mlist; private Integer pageIndex=1;//页码 private Integer rows=10;//行数 private Integer pageCount;//总页数 public String edituserdo(){ Manager mana= managerBI.findOne(null, managerId); mana.setManagerName(managerName); mana.setNickName(nickname); mana.setPassWord(passWord); mana.setDisabled(disabled); mana.setJurisdiction(jurisdiction); managerBI.edit(null, mana); return SUCCESS; } }
提交了没
提交了。增删改查 除了改以外都可以成功。
@叶含风: 有没有声明事务,代码有吗
事务没提交吧
debug跟踪一下看看