开发者社区> 问答> 正文

关于 整合ssh时报错

jsp数据提交页面:

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!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>
<s:form action="userAction" namespace="/user" method="post">
    <table width="200" border="1">
        <tr>
            <td>name</td>
            <td><s:textfield name="user.name"/></td>
        </tr>
        <tr>
            <td>password</td>
            <td><s:textfield name="user.pwd"/></td>
        </tr>
        <tr>
            <td colspan="2"><s:submit value="submit"/></td>
        </tr>
    </table>
</s:form>
</body>
</html>

控制台报错:

17:41:16,129 ERROR ParametersInterceptor:34 - Developer Notification (set struts.devMode to false to disable this message):
Unexpected Exception caught setting 'user.name' on 'class $Proxy10: Error setting expression 'user.name' with value '[Ljava.lang.String;@12dcbd'
17:41:16,180 ERROR ParametersInterceptor:34 - Developer Notification (set struts.devMode to false to disable this message):
Unexpected Exception caught setting 'user.pwd' on 'class $Proxy10: Error setting expression 'user.pwd' with value '[Ljava.lang.String;@1cbcf19'
um----------------------:null
 dao的实现类:


``
public class S3Impl implements UserDao{

    private SessionFactory sessionFactory = null;
    
    public void setSessionFactory(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
    }

    @Override
    public boolean create(UserModel um) {
        
        Session session = sessionFactory.getCurrentSession();
        session.save(um);

        return true;
    }

}

页面报错:

Struts Problem Report
Struts has detected an unhandled exception: 

Messages: attempt to create saveOrUpdate event with null entity 
 
File: org/hibernate/event/spi/SaveOrUpdateEvent.java 
Line number: 62

展开
收起
爵霸 2016-03-04 15:31:00 2295 0
1 条回答
写回答
取消 提交回答
  • Acion类请事先ModelDriver 接口!!

    2019-07-17 18:52:22
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载