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

📄 index.jsp

📁 使用JSP和Java Bean来构建一个网上书店。本章介绍的例子可以分成两大部分
💻 JSP
字号:
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="../include.jsp"%>
<%
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
adminMgr.isRightAdminPath(response,request);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>登录TurboShop管理后台</title>
<script language="JavaScript" type="text/JavaScript">
function login()
{
	theForm = document.loginform;
	if ( theForm.account.value=="" )
	{
		document.getElementById("logining_info").innerHTML = "帐号不能为空";
		document.getElementById("logining_info").className = "ErrorMsg";
		theForm.account.focus();
		return(false);
	}
	else if ( theForm.pwd.value=="" )
	{
		document.getElementById("logining_info").innerHTML = "密码不能为空";
		document.getElementById("logining_info").className = "ErrorMsg";
		theForm.pwd.focus();
		return(false);
	}
	else if ( theForm.licence.value=="" )
	{
		document.getElementById("logining_info").innerHTML = "验证码不能为空";
		document.getElementById("logining_info").className = "ErrorMsg";
		theForm.licence.focus();
		return(false);
	}

	document.getElementById("logining_info").innerHTML = "正在登陆…";
	document.getElementById("logining_info").className = "WarningMsg";
	return(true);
}

if (top.location !== self.location)
{ 
	top.location=self.location;
}
</script>
<style>
.OkMsg{
	padding:5px 5px 5px 25px;
	border:1px solid #00BE00;
	background:#E6FFE6 url(../imgs/standard_msg_ok.gif) 5px 5px no-repeat;
	color:#000;
	height:15px;
}
.WarningMsg{
	padding:5px 5px 5px 25px;
	border:1px solid #00A8FF;
	background:#E2F5FF url(../imgs/standard_msg_warning.gif) 5px 5px no-repeat;	
	color:#000;
	height:15px;
}
.ErrorMsg{
	padding:5px 5px 5px 25px;
	border:1px solid #F60;
	background:#FFF2E9 url(../imgs/standard_msg_error.gif) 5px 5px no-repeat;	
	color:#000;
	height:15px;
}
.l-bg {
	background-attachment: scroll;
	background-image: url(imgs/l_bg.jpg);
	background-repeat: repeat-x;
	background-position: center top;
}
</style>
<style type="text/css">
<!--
.lt {
	font-size: 13px;
	font-weight: bold;
	color: #2270D2;
	padding-top: 2px;
	padding-right: 12px;
	padding-bottom: 0px;
	padding-left: 0px;
}
td {
	font-size: 12px;
	color: #666666;
}
-->
</style>
<style type="text/css">
<!--
.text-input {
	background-color: #FFFFFF;
	height: 20px;
	width: 155px;
	border: 1px solid #b2b2b2;
	color: #DD0000;
}
.text-input2 {
	background-color: #FFFFFF;
	height: 20px;
	width: 70px;
	border: 1px solid #b2b2b2;
	color: #DD0000;
}
.login-b {
	background-attachment: fixed;
	background: url(imgs/login_b.gif);
	background-repeat: no-repeat;
	background-position: center center;
	height: 20px;
	width: 70px;
	border: 0px solid;
}
-->
</style>
</head>
<body bgcolor="999999" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="document.loginform.account.focus();">
<br>
<br>
<br>
<br>
<table width="753" height="400" border="0" align="center" cellpadding="0" cellspacing="0"  class="l-bg">
<iframe id="frameCheckForm" name="frameCheckForm" src="about:blank" width="0" height="0" scrolling="no"></iframe>
  <tr> 
    <td width="35" >&nbsp;</td>
    <td width="476" align="left" valign="top"><br>
      <br>
      <br>
      请使用IE登录<br>
      <br>
<form name=loginform action="login.jsp" method="post" target="frameCheckForm" onSubmit="return login()">
      <table width="225" height="120" border="0" cellpadding="3" cellspacing="0" background="imgs/login_bg.gif">
        <tr>
          <td width="413" align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
              <tr> 
                <td width="42%" align="center" valign="middle" class="lt"> 
                  <table width="75" border="0" cellspacing="0" cellpadding="0">
                    <%
String cookieAccount = StringUtil.getCookie(request,"account");
%>
                    <tr> 
                      <td width="20">
<input name="remember" type="checkbox" id="remeber2" value="1" <%=cookieAccount==null?"":"checked"%>></td>
                      <td width="55" class="text">
<label for="remeber2">记住帐号</label></td>
                    </tr>
                  </table>
                </td>
                <td width="58%" align="right" valign="middle" class="lt">请登录</td>
              </tr>
              <tr> 
                <td colspan="2"><table width="100%" border="0" cellpadding="3" cellspacing="0">
                    <tr> 
                      <td width="21%" height="20" align="right" class="text">帐 
                        号:</td>
                      <td width="79%"> <input name="account" type="text" class="text-input" id="account" tabindex="1" value="<%=cookieAccount==null?"":cookieAccount%>"></td>
                    </tr>
                    <tr> 
                      <td height="20" align="right" class="text">密 码:</td>
                      <td><input name="pwd" type="password" class="text-input" id="pwd3" tabindex="2"></td>
                    </tr>
                    <tr> 
                      <td align="right" class="text">验证码:</td>
                      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width="35%"><input name="licence" type="text" class="text-input2" id="licence5"  style="width:50px;" tabindex="3"> 
                            </td>
                            <td width="65%"><img id="licenceImg" src="<%=ConfigBean.getStringValue("systenFolder")%>loginLicence" border="0"></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
      </table>
      <br>
      <table width="353" border="0" cellspacing="0" cellpadding="4">
        <tr> 
          <td width="85"><input name="Submit" type="submit" class="login-b" value=" "></td>
          <td width="252"><span id="logining_info" style="letter-spacing: 2px;"></span></td>
        </tr>
      </table></form> </td>
    <td width="242" align="right" valign="top" style="padding-right:20px;padding-top:20px;"><img src="imgs/turboshop_logo2.gif" width="169" height="33"></td>
  </tr>
</table>
<table width="753" height="20" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr>
    <td width="1043" align="right" valign="middle" bgcolor="#2270D2"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">&copy;2006-2008 TurboShop.cn - All Rights Reserved.</font></td>
  </tr>
</table>

</body>
</html>

⌨️ 快捷键说明

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