有三四个页面,页面开头部分是一个判断要不要转到这个页面的代码。1.如果不符合跳转的条件,其中几个都能正确判断,会弹出一个对话框。唯独有一个页面不弹对话框,而是直接报错。2.如果符合跳转的条件,那个页面就能正常显示了。出错页面代码如下:(其中html之前是我所说的前面相同的判断代码)<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/Common.jsp"%>
<%@ include file="/Check.jsp"%>
<%
    String username = (String) session.getValue("UserName");
    if(!Employee.IsExist(username))
    { %>
    <script>
    alert("您还没有添加过基本资料,请先添加!");
    window.history.back();
    </script>
    <% } 
    
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<title><%=title%></title>
<link rel="stylesheet" href="/PersonManage/css/style.css"
type="text/css" media="screen">
<script type="text/javascript"
src="/PersonManage/datePicker/WdatePicker.js"></script>
<script Language="JavaScript">
function check_input(theForm)
{
  if (theForm.employeeid.value.length != 8)
  {
    alert("职工编号必须为8位。");
    theForm.employeeid.focus();
    return (false);
  }  
  if (theForm.username.value == "")
  {
    alert("请输入姓名。");
    theForm.username.focus();
    return (false);
  }
   
}
</script> </head>
<%@ include file="../incoming/Header.jsp"%>
<%
String id = (String) session.getValue("UserName");
String employeeid = new String(id.getBytes("ISO8859_1"), "UTF-8");
Employee employee = Employee.FindByID(employeeid);
%>
<table width="780" border="0" align="center" cellpadding="0"
cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="120" valign="top" background="../images/in_left_bg.gif"><%@ include
file="EmployeeLeft.jsp"%></td>
<td width="660" align="center">
<p align="center" class="title1">
修改基本资料
</p>
<form name="form1" method="post" action="ModifyEmployeeStep2.jsp"
onsubmit="return check_input(this)"><TABLE border=0 cellSpacing=1 cellPadding=0 width=640 height="513"
bgColor=#dedee9 align=center>
<TD width=92 align=middle>性别</TD>
<TD colSpan=2>
<%if (employee.getSex().equals("男")) {%>
<INPUT type="radio" name="sex" value="男" checked>
男<%
} else {
%>
<INPUT type="radio" name="sex" value="男">
男<%}%>
<%if (employee.getSex().equals("女")) {%>
<INPUT type="radio" name="sex" value="女" checked>
女<%
} else {
%>
<INPUT type="radio" name="sex" value="女">
女<%
}
%>
</TD>
</Table>

</form>
</td>
</tr>
</table>
<%@ include file="../incoming/Footer.jsp"%>
</body>
</html>代码我经过了简化,其中,如果把红色代码删除,就不会出现问题了,难道红色部分代码和前面几行发生了冲突??怎么解决??