为了账号安全,请及时绑定邮箱和手机立即绑定

新手求教,谢谢各位。

新手求教,谢谢各位。

小菜鸟爱学习 2016-05-09 22:15:39
异常信息:严重: Exception occurred during processing request: Method "regist" failed for object action.UsersAction@3855cf59ognl.MethodFailedException: Method "regist" failed for object action.UsersAction@3855cf59 [java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration].jsp内容:<form name="registFrom" action="<%=path%>/users/Users_regist.action" method="post">  <div class="mainBg">   <div class="username"><span>用户名:</span>   <input id="username" name="username" type="text" placeholder="请输入用户名" onblur="checkname();">    <span id="checkbox"></span>    </div>   <div class="name"><span>真实姓名:</span>   <input id="name" type="text" placeholder="请输入姓名" name="name">   </div>   <div class="sex"><span>性&nbsp;&nbsp;&nbsp;别:</span>   <label><input id="man" type="radio" name="sex" value="男" checked="checked">男</label>   <label><input id="woman" type="radio" name="sex" value="女">女</label>   </div>   <div class="password"><span>密&nbsp;&nbsp;&nbsp;码:</span>   <input id="password" type="password" placeholder="请输入密码" name="password">   </div>   <div class="qpassword"><span>确认密码:</span>   <input id="qpassword" type="password" placeholder="确认密码" name="qpassword">   </div>    <div class="phone"><span>手机号:</span>   <input id=phone type="text" placeholder="请输入手机号" name="phonenum">   </div>   <div class="regist">   <input id="regist" type="submit" value="注册">   </div>   </div>   </form>service层:public boolean usersRegist(Users u) { Transaction tx = null; Session session = MyHibernateSessionFactory.getSessionFactory().getCurrentSession(); try{ tx = session.beginTransaction();         session.save(u);        tx.commit();        return true; } catch(Exception ex){ ex.printStackTrace(); session.getTransaction().rollback(); return false; }finally{ if(tx != null){ tx = null; } } }action层:public class UsersAction extends SuperAction implements ModelDriven<Users>{ private static final long serialVersionUID = 1L; private Users user = new Users(); public String regist(){ UsersDAO udao = new UsersDAOImpl(); if(udao.usersRegist(user)){ return "regist_success"; }else{ return "regist_failure"; } } public Users getModel() { // TODO Auto-generated method stub return user; } }struts.xml配置:<package name="users" namespace="/users" extends="default">     <action name="*_*" class="action.{1}Action" method="{2}">      <result name="regist_success">/users/Users_login_success.jsp</result>      <result name="regist_failure">/users/Users_login.jsp</result>     </action>    </package> 
查看完整描述

1 回答

?
qq___571

TA贡献11条经验 获得超1个赞

jar包没没找到 放到lib目录下

查看完整回答
反对 回复 2016-09-09
  • 1 回答
  • 0 关注
  • 1661 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信