jsp问题,找不到错误
InputStuMessage.jsp
<%@ page contentType="text/html;charset=gb2312" %>
<html><head>
<script language="javascript" >
function CheckSubmit(){
if(document.nform.name.value=""){
alert("请输入姓名!");
document.nform.name.focus();
return false;
}
if(document.nform.stunumber.value=""){
alert("请输入学号!");
document.nform.stunumber.focus();
return false;
}
if(document.nform.sclass.value=""){
alert("请输入班级!");
document.nform.sclass.focus();
return false;
}
}
</script>
</head>
<body>
<div align=center>
<p>欢迎你,请输入学生的相关信息:</p>
<form action="ShowMessage.jsp" method="post" name="nform">
<table border="0" cellspacing="1" cellpadding="1">
<tr><td>
姓名:<input type=text name="name" size="20">
</td></tr>
<tr><td>
学号:<input type=text name="stunumber" size="20">
</td></tr>
<tr><td>
性别:<input type=radio name="gender" value="m" checked>男
<input type=radio name="gender" value="f"checked>女
</td></tr>
<tr><td>
班级:<input type=text name="sclass" size="20">
</td></tr>
<tr><td>
专业:<select name="speciality">
<option value="1" selected>计算机应用</option>
<option value="2" >计算机网络</option>
<option value="3" >计算机结构</option>
</select>
</td></tr>
<tr><td>
<input type="submit" name="submit" value="确定" onclick="return CheckSubmit();">
<input type="reset" name="reset" value="重新填写" >
</td></tr>
</table>
</form>
</div>
</body>
</html>
showMessage.jsp
<%@ page contentType="text/html;charset=gb2312" %>
<html><head>
<script language="javascript" >
function CheckSubmit(){
if(document.nform.name.value=""){
alert("请输入姓名!");
document.nform.name.focus();
return false;
}
if(document.nform.stunumber.value=""){
alert("请输入学号!");
document.nform.stunumber.focus();
return false;
}
if(document.nform.sclass.value=""){
alert("请输入班级!");
document.nform.sclass.focus();
return false;
}
}
</script>
</head>
<body>
<div align=center>
<p>欢迎你,请输入学生的相关信息:</p>
<form action="ShowMessage.jsp" method="post" name="nform">
<table border="0" cellspacing="1" cellpadding="1">
<tr><td>
姓名:<input type=text name="name" size="20">
</td></tr>
<tr><td>
学号:<input type=text name="stunumber" size="20">
</td></tr>
<tr><td>
性别:<input type=radio name="gender" value="m" checked>男
<input type=radio name="gender" value="f"checked>女
</td></tr>
<tr><td>
班级:<input type=text name="sclass" size="20">
</td></tr>
<tr><td>
专业:<select name="speciality">
<option value="1" selected>计算机应用</option>
<option value="2" >计算机网络</option>
<option value="3" >计算机结构</option>
</select>
</td></tr>
<tr><td>
<input type="submit" name="submit" value="确定" onclick="return CheckSubmit();">
<input type="reset" name="reset" value="重新填写" >
</td></tr>
</table>
</form>
</div>
</body>
</html>
配置好了的StuMessage.java
package bean;
public class StuMessage {
public String name;
public String stunumber;
public String gender;
public String sclass;
public int speciality;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getStunumber() {
return stunumber;
}
public void setStunumber(String stunumber) {
this.stunumber = stunumber;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getSclass() {
return sclass;
}
public void setSclass(String sclass) {
this.sclass = sclass;
}
public int getSpeciality() {
return speciality;
}
public void setSpeciality(int speciality) {
this.speciality = speciality;
}
}
错误的提示:
[解决办法]
提示的很清楚了,,你没有使用的标签没有成对匹配。或者说没有关闭。