日期:2014-05-20  浏览次数:20674 次

登陆页面没有值传入ACTION 大家帮帮忙啊~
我写了一个登陆界面 可是测试了N次 页面上没有值传入ACTION。 请大家帮忙看看。

JSP页面
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<html>
<head>
<title></title>
</head>

<body bgcolor="#FFFFFF">
<script language="javascript">
function check()
{
if (document.form1["username"].value==""||document.form1["password"].value=="")
{
alert("Please enter your Username or Password!");
return false;
}
}
</script>
<table >
  <tr>
  <td >
<s:form action="login.action" method="post" name="form1">
  <table >
  <tr>
  <td >
   
  <table>
  <tr>
  <td colspan="2" height="100">&nbsp;</td>
  </tr>
  <tr>
  <td width="300px" align="right"><b>Username :</b> </td>
  <td width="300px" valign="top">
  <input type=text name="username" style="width:150px;" />
  </td> 
  </tr>
  <tr><td colspan="2" height="10px"></td></tr>
  <tr>
  <td align="right"><b>Password :</b> </td>
  <td valign="top">
  <input type=password name="password" style="width:150px;" />
  </td> 
  </tr>
  <tr><td colspan="2" height="10px"></td></tr>
  <tr>
  <td colspan="2" align="right">
  <input type=submit value="Sign in" onclick="return check();" /> &nbsp;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </td>
  </tr> 
  </table>
   
  </td>
  </tr>
  </table>
</s:form>
</td>
  </tr>
</table>
</body>
</html>

user.java


package domain;

public class User {

private int user_id;
private String school_id;
private String user_name;
private String password;
private String sex;
private String birthday;
private String email;
private String phone;
private String status;
private String delflag;
private String create_user;
private String create_time;
private String update_user;
private String update_time;

public int getUser_id() {
return user_id;
}
public void setUser_id(int user_id) {
this.user_id = user_id;
}
public String getSchool_id() {
return school_id;
}
public void setSchool_id(String school_id) {
this.school_id = school_id;
}
public String getUser_name() {
return user_name;
}
public void setUser_name(String user_name) {
this.user_name = user_name;