⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.jsp

📁 计算机技术的快速发展
💻 JSP
字号:
<%@page contentType="text/html; charset=gb2312" language="java" errorPage="error.jsp"%>
<%@page import="com.suninformation.*,com.suninformation.user.*,com.suninformation.tools.*"%>
<%request.setCharacterEncoding("gb2312");%>
<html>
<head>
<title>用户登陆 - 沈航网络</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Includes/user.css" rel="stylesheet" type="text/css">
<style type="text/css">
  <!--
    body {
    background-image: url(Images/bg.jpg);
    }
    body,td,th {
		font-size: 12px;
    }
  -->
</style>
<link href="Includes/im.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff">
<%
  boolean userLogin = ParamUtils.getBooleanParameter(request, "userlogin", false); //操作参数值
  String url = ParamUtils.getParameter(request, "url"); //来源地址参数值
  String userName = null;
  String password = null;
  boolean errorUserName = false;
  boolean errorPassword = false;
  boolean errorUserNotFound = false;
  boolean errorUnacceptable = false;
  boolean errors = false;
  if ("null".equals(url)) {
    url = null;
  }
  if (userLogin) {
    userName = ParamUtils.getParameter(request, "username");
    password = ParamUtils.getParameter(request, "password");
    if (userName == null) {
      errorUserName = true;
    }
    if (password == null) {
      errorPassword = true;
    }
    errors = errorUserName || errorPassword;
    if (!errors) {
      try {
        User us = UserManager.getUserProxy().getUser(userName);
        if (userName != null && password != null) {
          if (CheckValue.md5(password).equals(us.getPassword())) {
            us.setLastLoginIp(request.getRemoteAddr());
            us.setLastLoginTime(new java.sql.Date(System.currentTimeMillis()));
            us.setLoginCount(us.getLoginCount() + 1);
            us.setOnLine(1);
            us.save();
            session.setAttribute("userName", userName);
            session.setAttribute("userType", String.valueOf(us.getUserType()));
            session.setAttribute("loginIp", us.getLastLoginIp());
            session.setAttribute("loginCount",String.valueOf(us.getLoginCount()));
            session.setAttribute("loginTime", us.getLastLoginTime());
          }
          else {
            throw new UnacceptableException("对不起,您输入的密码不正确!");
          }
        }
      }
      catch (UserNotFoundException e) {
        throw new UserNotFoundException("对不起,这个用户没有找到!");
      }
      if (url == null) {
        response.sendRedirect("main.jsp?username=" + userName);
      }
      else {
        response.sendRedirect(response.encodeURL(url));// + "?username=" + userName);
      }
    }else {
		throw new UnacceptableException("请正确填写您的用户名及密码!");
	}
  }
%>
<TABLE WIDTH=776 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  <TR>
    <TD width="10" ROWSPAN=2>&nbsp;</TD>
    <TD><IMG SRC="Images/WEB_Page1_14.jpg" WIDTH=766 HEIGHT=9 ALT=""></TD>
  </TR>
  <TR>
    <TD background="Images/WEB_Page1_15.jpg"><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="3" align="right"><font color="#747474"><a href="http://www.aoke2008.com" class="title">沈航首页</a>| <a href="#" class="title" onClick="JavaScript:window.external.addFavorite('http://www.aoke2008.com/','奥克资讯网');return false;">加入收藏</a> | <a href="#" class="title" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.aoke2008.com/')">设为首页</a> | 网站导航</font></td>
          <td width="29">&nbsp;</td>
        </tr>
        <tr>
          <td width="19" valign="top">&nbsp;</td>
          <td width="213" valign="top"><img src="Images/111.jpg" width="188" height="73"><br>
</td>
          <td width="505" valign="baseline"><table width="100%"  border="0" align="center" cellpadding="1" cellspacing="1">
            <tr>
              <td align="center"><a href="login.jsp" class="title">用户登陆</a> - <a href="register.jsp" class="title">注册新用户</a> - <a href="recover_pwd.jsp" class="title">取回密码</a> </td>
              </tr>
          </table></td>
          <td valign="top">&nbsp;</td>
        </tr>
    </table></TD>
  </TR>
</table>
<TABLE WIDTH=776 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  <TR>
    <TD width="10" ROWSPAN=2>&nbsp;</TD>
    <TD> <IMG SRC="Images/WEB_Page1_14.jpg" WIDTH=766 HEIGHT=9 ALT=""></TD>
  </TR>
  <TR>
    <TD background="Images/WEB_Page1_15.jpg">
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="2">&nbsp;</td>
          <td width="29">&nbsp;</td>
        </tr>
        <tr>
          <td width="17" height="159" valign="top">&nbsp;</td>
          <td width="720" align="center" valign="top"> 
              <table width="304" height="24" border="0" cellpadding="0" cellspacing="0" class="td_downLine">
                <tr>
                  <td width="15" class="td_downLine">&nbsp;</td>
                  <td width="282" class="td_downLine">
                    <img src="Images/arrow_04.gif" width="7" height="7"> 用户登陆 </td>
					  <br>
                </tr>
            </table>
              <table width="304" border="0" align="center" cellpadding="1" cellspacing="1">
                <form action="" method="post" name="frmUserLogin" id="frmUserLogin">
                  <tr>
                    <td width="103" height="30" align="right" class="td_downLine">用户名:</td>
                    <td width="194" class="td_downLine">
                      <input name="username" type="text" id="username2" maxlength="16" style="FONT-SIZE: 12px; WIDTH: 100px">                    </td>
                  </tr>
                  <tr>
                    <td height="30" align="right" class="td_downLine"> 密&nbsp;&nbsp;码: </td>
                    <td class="td_downLine">
                      <input name="password" type="password" id="password" maxlength="16" style="FONT-SIZE: 12px; WIDTH: 100px">
                    </td>
                  </tr>
                  <tr>
                    <td height="30">
                      <blockquote>
                        <p>
                          <input name="userlogin" type="hidden" id="userlogin" value="true">
                        </p>
                    </blockquote></td>
                    <td>
                      <input type="submit" name="btn_userlogin" value="登陆" style="FONT-SIZE: 12px; WIDTH: 80px">
                      <input name="btn_answer" type="reset" id="btn_userlogin" style="FONT-SIZE: 12px; WIDTH: 60px" value="重填">
                    </td>
                  </tr>
                </form>
            </table>
              <br>
          </td>
          <td valign="top">&nbsp;</td>
        </tr>
    </table></TD>
  </TR>
</table>
<TABLE WIDTH=776 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  <TR>
    <TD width="10" ROWSPAN=3>&nbsp;</TD>
    <TD><IMG SRC="Images/WEB_Page1_14.jpg" WIDTH=766 HEIGHT=9 ALT=""></TD>
  </TR>
  <TR>
    <TD background="Images/WEB_Page1_15.jpg"><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="2">&nbsp;</td>
          <td width="29">&nbsp;</td>
        </tr>
        <tr>
          <td width="17" valign="top">&nbsp;</td>
          <td width="720" align="center" valign="top"><font color="#b1b1b1"><a href="../about_aoke_cn.htm" class="title">关于沈航</a></font> <font color="#b1b1b1">|</font> <font color="#b1b1b1">服务条款</font> <font color="#b1b1b1">|</font> <font color="#b1b1b1">广告服务</font> <font color="#b1b1b1">|</font> <font color="#b1b1b1">沈航招聘</font> <font color="#b1b1b1">|</font> <font color="#b1b1b1">客服中心</font> <font color="#b1b1b1">|</font> <font color="#b1b1b1">联系我们</font><font style="font-size: 12px; line-height: 24px;" color="#b2b2b2"><br>
           <br>
            沈阳航空工业学院&nbsp;版权所有</font></td>
          <td valign="top">&nbsp;</td>
        </tr>
    </table></TD>
  </TR>
  <TR>
    <TD><IMG SRC="Images/WEB_Page1_17.jpg" WIDTH=766 HEIGHT=22 ALT=""> </TD>
  </TR>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -