日期:2014-05-17  浏览次数:20851 次

ssh中jsp页面的数据怎么提交不到action中
在注册页面输入数据后点注册,然后提示空指针异常
注册页面代码:

<%@ page contentType="text/html;charset=gbk" language="java" %>
<%@taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    
    <title>My JSP 'regist.jsp' starting page</title>
    
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

  </head>
  
  <body style="background-color: green;">
    <div style="margin-top: 100px" align="center">
     <h1>普通用户注册</h1>
     <hr style="color: black;">
     <br>
        <s:form action="regist" method="POST">
            <s:textfield name="uName" id="uName" label="用户名"></s:textfield>
            <br>
            <s:password name="uKey"  label="密码" size="21"></s:password>
            <br>
            <s:submit  value="注册"/>
        </s:form>
    </div>
  </body>
</html>
注册对应的action:
package com.one.action;


import com.one.bean.UserEntity;
import com.one.service.UserService;
import com.opensymphony.xwork2.ActionSupport;

public class registAction extends ActionSupport {

private UserEntity user;
    private String uName;
    private String uKey;

    public String getuName() {
        return uName;
    }