<%@page contentType="text/html; charset=GBK" language="java"%>
<%request.setCharacterEncoding("GBK");String strUserID  = request.getParameter("userid");
String strUserPin = request.getParameter("userpin");
String strUrl     = request.getParameter("location");%>
<html>
<HEAD>
<title>��Ϣ����ϵͳ_����ƽ̨</title>
<script language="JavaScript">
function userlogin()
{
    if(login.userid.value =="")
    {
        alert("�������û����");
        return false;
    }
    if(login.userpin.value =="")
    {
        alert("�������û�����");
        return false;
    }
    login.submit();
}
if (parent.location!=self.location)
    parent.location=self.location;
</script>
<style type="text/css">
<!--
td{font-size:13px}
.bt { text-align: center; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: #CCCCCC;font-size:13px}
.txt { padding-top:5px;border: #cccccc 1px solid;height:30px;font-size:13px;width:200px}
.top{font-size:24px;font-weight:bold;color:#EBBD03}
.centerup {background-repeat:repeat-x;background-position:left top;}
.centerbot {background-repeat:repeat-x;background-position:left bottom;}
.centerleft {background-repeat:repeat-y;background-position:left top;}
.centerright {background-repeat:repeat-y;background-position:right top;}
--></style>
<link href="../images/rootstyle.css" rel="stylesheet" type="text/css">
</HEAD>
<body topmargin="0" background="../images/bg1.jpg">
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="67" class=top width="359"><img src="../images/topleft.gif" width="359" height="88"></td>
    <td width="401" height="67" class=top><img src="../images/topright.gif" width="401" height="88"></td>
  </tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" background="../images/linebg.gif" bgcolor="#FFFFFF">
  <tr>
    <td width="182" style="background-repeat:repeat-y;background-position:top left"></td>
    <td width="399" height="314" align="right">
      <table border="0" align=center><tr>
          <td height="22"></td>
        </tr><tr>
          <td height="22"><img src="../images/logintitle.gif" width="121" height="33"></td></tr><tr>
          <td height="22"></td>
        </tr></table>
      <table width="394" height="100" border=0 align="center" cellPadding=0
      cellSpacing=0 borderColor=#999999 borderColorDark=#ffffff>
        <tr>
          <td height="11"><table width="100%" height="11" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="12" height="11"><img src="../images/leftupcon.gif" width="12" height="11"></td>
                <td width="370" background="../images/centerup.gif" class="centerup"></td>
                <td width="12" height="11"><img src="../images/rightupcon.gif" width="12" height="11"></td>
        </tr></table></td>
  </tr>
  <tr>
          <td height="30" bgcolor="#f2fafa">
            <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="12" background="../images/centerleft.gif" class="centerleft"></td>
                <td width="375" height="30">
<%
if(strUrl == null) strUrl = "../infopub/";
    com.prime.system.userOper userBean = new com.prime.system.userOper();
    String strReg=userBean.getUser_Register("010001");
    if (strReg.equals("")){
        out.print("ϵͳ���������");
        return;
    }
if(strUserID != null && strUserPin != null)
{
    //com.prime.system.userOper  userBean = new com.prime.system.userOper();
    if(userBean.isRegUser(strUserID,strUserPin))
    {
        session.putValue("userid",strUserID);
        session.putValue("username",userBean.getUserName());
        session.putValue("deptid",userBean.getDeptID());
        session.putValue("deptname",userBean.getDeptName());
        if(strUserID.equals("developer"))
            response.sendRedirect("../system/const/mainpanel.jsp");
        else
            response.sendRedirect(strUrl);
    } else {
        %>
                 <table width="375" height="177" border="0" align=center>
                      <tr>
                        <td height="22" align="center" bgcolor="#f2fafa"><font color="red" size="2"><%=userBean.getLastErrMsg()%></font><br><br>
<input type="button" name="Submit2" value="���µ�¼" onclick="window.location='login.jsp';" style="width:100px;padding-top:2px;" class="but01"></td></tr>
                    </table>
<% //return;
    }
}
else
{%> <form name="login" method="post" action="login.jsp">
                     <%
  String strLogin=request.getParameter("loginfo");
  if (strLogin!=null){%><table width="375" height="177" border="0" align=center>
                      <tr>
                        <td height="22" bgcolor="#f2fafa"><font color="red" size="2">
                          <%out.print(strLogin);%>
                          &nbsp;</font></td>
                      </tr>
                    </table><%
                    }else{%>
                    <table width="100%" height="100" border="0" align="center" cellpadding="0" cellspacing="0">
                      <input type="hidden" name="location" value="<%=strUrl%>">
                      <tr>
                        <td width="133" height="20">&nbsp;</td>
                        <td width="231" height="20" colspan="2">&nbsp; </td>
                      </tr>
                      <tr>
                        <td width="133" height="40" align="right" valign="middle" style="font-size:16px;font-weight:bolder;color:#CB4402">�û���ţ�</td>
                        <td height="28" colspan="2" width="133"><input type="text" name="userid" maxlength="20" size="20" class="txt">
                        </td>
                      </tr>
                      <tr>
                        <td width="133" height="40" align="right" valign="middle" style="font-size:16px;font-weight:bolder;color:#CB4402">�û����</td>
                        <td height="28" colspan="2"><input type="password" name="userpin" size="20" maxlength="20" class="txt"></td>
                      </tr>
                      <tr valign="bottom">
                        <td height="50" colspan="3" align="right">
                          <input type=image src="../images/userlogin.gif" width="78" height="38" onclick="javascript:return userlogin();" style="cursor:hand;border:0">
                          <input type=image src="../images/reset.gif" width="60" height="38" onClick="login.reset(); return false;" style="cursor:hand;border:0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                      </tr>
                      <tr align="left">
                        <td height="27" colspan="3" valign="bottom">
                          <%}
                 if ( strReg.equals("1")){//�����û�ע��
                  %>
                          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="javascript: window.open('userreg.jsp',null,'resizable=yes,scrollbars=yes,width=382,height=480,top='+(screen.height-480)/2+',left='+(screen.width-382)/2+'');" style="cursor:hand" target="_blank"><img src="../images/userreg.gif" width="102" height="27"></a>
                          <%}%>
                        </td>
                      </tr>
                    </table>
                  </form>
<SCRIPT language="JavaScript">
document.login.userid.focus();
</SCRIPT> <%}%></td>
                <td width="12" background="../images/centerright.gif" class="centerright"></td>
        </tr>
        </table>
</td></tr>
        <tr>
          <td height="11"><table width="100%" height="11" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="12"><img src="../images/leftbotcon.gif" width="12" height="11"></td>
          <td width="370" background="../images/centerbot.gif" class="centerbot"></td>
          <td width="12"><img src="../images/rightbotcon.gif" width="12" height="11"></td>
        </tr></table></td>
  </tr>
  <tr>
          <td height="70"><table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
</table></td>
  </tr>
</table>
    </td>
    <td width="182" valign="top" style="background-repeat:repeat-y;background-position:top right">&nbsp;
    </td>
  </tr></table>
<table width="760" height="16" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="16" align="center" bgcolor="#FFFFFF" background="../images/bbg.jpg" style="background-position:top right"><img src="../images/botbor.gif" width="760" height="16"></td>
</table>
</body>
</html>������δ��룬Ϊʲô��ϵͳ��������

解决方案 »

  1.   

    <%@page contentType="text/html; charset=GBK" language="java"%> 
    <%request.setCharacterEncoding("GBK"); String strUserID  = request.getParameter("userid"); 
    String strUserPin = request.getParameter("userpin"); 
    String strUrl    = request.getParameter("location");%> 
    <html> 
    <HEAD> 
    <title>信息管理系统_管理平台 </title> 
    <script language="JavaScript"> 
    function userlogin() 

        if(login.userid.value =="") 
        { 
            alert("请输入用户编号"); 
            return false; 
        } 
        if(login.userpin.value =="") 
        { 
            alert("请输入用户口令"); 
            return false; 
        } 
        login.submit(); 

    if (parent.location!=self.location) 
        parent.location=self.location; 
    </script> 
    <style type="text/css"> 
    <!-- 
    td{font-size:13px} 
    .bt { text-align: center; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: #CCCCCC;font-size:13px} 
    .txt { padding-top:5px;border: #cccccc 1px solid;height:30px;font-size:13px;width:200px} 
    .top{font-size:24px;font-weight:bold;color:#EBBD03} 
    .centerup {background-repeat:repeat-x;background-position:left top;} 
    .centerbot {background-repeat:repeat-x;background-position:left bottom;} 
    .centerleft {background-repeat:repeat-y;background-position:left top;} 
    .centerright {background-repeat:repeat-y;background-position:right top;} 
    --> </style> 
    <link href="../images/rootstyle.css" rel="stylesheet" type="text/css"> 
    </HEAD> 
    <body topmargin="0" background="../images/bg1.jpg"> 
    <table width="760" border="0" cellspacing="0" cellpadding="0" align="center"> 
      <tr> 
        <td height="67" class=top width="359"> <img src="../images/topleft.gif" width="359" height="88"> </td> 
        <td width="401" height="67" class=top> <img src="../images/topright.gif" width="401" height="88"> </td> 
      </tr> 
    </table> 
    <table width="760" border="0" align="center" cellpadding="0" cellspacing="0" background="../images/linebg.gif" bgcolor="#FFFFFF"> 
      <tr> 
        <td width="182" style="background-repeat:repeat-y;background-position:top left"> </td> 
        <td width="399" height="314" align="right"> 
          <table border="0" align=center> <tr> 
              <td height="22"> </td> 
            </tr> <tr> 
              <td height="22"> <img src="../images/logintitle.gif" width="121" height="33"> </td> </tr> <tr> 
              <td height="22"> </td> 
            </tr> </table> 
          <table width="394" height="100" border=0 align="center" cellPadding=0 
          cellSpacing=0 borderColor=#999999 borderColorDark=#ffffff> 
            <tr> 
              <td height="11"> <table width="100%" height="11" border="0" cellpadding="0" cellspacing="0"> 
                  <tr> 
                    <td width="12" height="11"> <img src="../images/leftupcon.gif" width="12" height="11"> </td> 
                    <td width="370" background="../images/centerup.gif" class="centerup"> </td> 
                    <td width="12" height="11"> <img src="../images/rightupcon.gif" width="12" height="11"> </td> 
            </tr> </table> </td> 
      </tr> 
      <tr> 
              <td height="30" bgcolor="#f2fafa"> 
                <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> 
                  <tr> 
                    <td width="12" background="../images/centerleft.gif" class="centerleft"> </td> 
                    <td width="375" height="30"> 
    <% 
    if(strUrl == null) strUrl = "../infopub/"; 
        com.prime.system.userOper userBean = new com.prime.system.userOper(); 
        String strReg=userBean.getUser_Register("010001"); 
        if (strReg.equals("")){ 
            out.print("系统常量表错误!"); 
            return; 
        } 
    if(strUserID != null && strUserPin != null) 

        //com.prime.system.userOper  userBean = new com.prime.system.userOper(); 
        if(userBean.isRegUser(strUserID,strUserPin)) 
        { 
            session.putValue("userid",strUserID); 
            session.putValue("username",userBean.getUserName()); 
            session.putValue("deptid",userBean.getDeptID()); 
            session.putValue("deptname",userBean.getDeptName()); 
            if(strUserID.equals("developer")) 
                response.sendRedirect("../system/const/mainpanel.jsp"); 
            else 
                response.sendRedirect(strUrl); 
        } else { 
            %> 
                    <table width="375" height="177" border="0" align=center> 
                          <tr> 
                            <td height="22" align="center" bgcolor="#f2fafa"> <font color="red" size="2"> <%=userBean.getLastErrMsg()%> </font> <br> <br> 
    <input type="button" name="Submit2" value="重新登录" onclick="window.location='login.jsp';" style="width:100px;padding-top:2px;" class="but01"> </td> </tr> 
                        </table> 
    <% //return; 
        } 

    else 
    {%> <form name="login" method="post" action="login.jsp"> 
                        <% 
      String strLogin=request.getParameter("loginfo"); 
      if (strLogin!=null){%> <table width="375" height="177" border="0" align=center> 
                          <tr> 
                            <td height="22" bgcolor="#f2fafa"> <font color="red" size="2"> 
                              <%out.print(strLogin);%> 
                              &nbsp; </font> </td> 
                          </tr> 
                        </table> <% 
                        }else{%> 
                        <table width="100%" height="100" border="0" align="center" cellpadding="0" cellspacing="0"> 
                          <input type="hidden" name="location" value=" <%=strUrl%>"> 
                          <tr> 
                            <td width="133" height="20">&nbsp; </td> 
                            <td width="231" height="20" colspan="2">&nbsp; </td> 
                          </tr> 
                          <tr> 
                            <td width="133" height="40" align="right" valign="middle" style="font-size:16px;font-weight:bolder;color:#CB4402">用户编号: </td> 
                            <td height="28" colspan="2" width="133"> <input type="text" name="userid" maxlength="20" size="20" class="txt"> 
                            </td> 
                          </tr> 
                          <tr> 
                            <td width="133" height="40" align="right" valign="middle" style="font-size:16px;font-weight:bolder;color:#CB4402">用户口令: </td> 
                            <td height="28" colspan="2"> <input type="password" name="userpin" size="20" maxlength="20" class="txt"> </td> 
                          </tr> 
                          <tr valign="bottom"> 
                            <td height="50" colspan="3" align="right"> 
                              <input type=image src="../images/userlogin.gif" width="78" height="38" onclick="javascript:return userlogin();" style="cursor:hand;border:0"> 
                              <input type=image src="../images/reset.gif" width="60" height="38" onClick="login.reset(); return false;" style="cursor:hand;border:0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td> 
                          </tr> 
                          <tr align="left"> 
                            <td height="27" colspan="3" valign="bottom"> 
                              <%} 
                    if ( strReg.equals("1")){//允许用户注册 
                      %> 
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a onclick="javascript: window.open('userreg.jsp',null,'resizable=yes,scrollbars=yes,width=382,height=480,top='+(screen.height-480)/2+',left='+(screen.width-382)/2+'');" style="cursor:hand" target="_blank"> <img src="../images/userreg.gif" width="102" height="27"> </a> 
                              <%}%> 
                            </td> 
                          </tr> 
                        </table> 
                      </form> 
    <SCRIPT language="JavaScript"> 
    document.login.userid.focus(); 
    </SCRIPT> <%}%> </td> 
                    <td width="12" background="../images/centerright.gif" class="centerright"> </td> 
            </tr> 
            </table> 
    </td> </tr> 
            <tr> 
              <td height="11"> <table width="100%" height="11" border="0" cellpadding="0" cellspacing="0"> 
            <tr> 
              <td width="12"> <img src="../images/leftbotcon.gif" width="12" height="11"> </td> 
              <td width="370" background="../images/centerbot.gif" class="centerbot"> </td> 
              <td width="12"> <img src="../images/rightbotcon.gif" width="12" height="11"> </td> 
            </tr> </table> </td> 
      </tr> 
      <tr> 
              <td height="70"> <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"> 
    </table> </td> 
      </tr> 
    </table> 
        </td> 
        <td width="182" valign="top" style="background-repeat:repeat-y;background-position:top right">&nbsp; 
        </td> 
      </tr> </table> 
    <table width="760" height="16" border="0" align="center" cellpadding="0" cellspacing="0"> 
      <tr> 
        <td height="16" align="center" bgcolor="#FFFFFF" background="../images/bbg.jpg" style="background-position:top right"> <img src="../images/botbor.gif" width="760" height="16"> </td> 
    </table> 
    </body> 
    </html> 
      

  2.   

    userBean.getUser_Register("010001"); 
    看这个方法里面咋写的啊
    估计是010001这个用户没有注册吧
      

  3.   

    <%@page contentType="text/html; charset=gb2312" language="java"%> 
    request.setCharacterEncoding("gb2312"); 
    改下编码方式试试!
    if(strUrl == null) strUrl = "../infopub/"; 
        com.prime.system.userOper userBean = new com.prime.system.userOper(); 
        String strReg=userBean.getUser_Register("010001"); 
        if (strReg.equals("")){ 
            out.print("系统常量表错误!"); 
            return; 
        } 
    010001取出的值是""所以报“系统常量错误”,你要不直接把要跳转到的面写到上面的if语句中,不过貌似应该不行,因为你需要把值存入session,后面的页面可顶都需要判断session,那么只有建立个01001了,依照页面上session需要存储的建应该就可以了