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

📄 login.jsp

📁 一套购物车项目。电子商务系统。实现了前台和后台的业务逻辑。
💻 JSP
字号:
<%@ page contentType="text/html;charset=gb2312" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
  	String contextPath = request.getContextPath();
%>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title>登录</title>
<link href="<%=contextPath%>/css/css.css" type="text/css" rel="stylesheet" />
</head>
<script>
	function loadrand(){
		var obj=document.getElementById("code");
		obj.src="<%=contextPath%>/shop/image.jsp";
	} 
	function check(){
		var loginName=form1.loginname.value;
		if(loginName.length<=0){
			alert('用户名不能为空');
			return false;
		}
		var loginPassword=form1.password.value;
		if(loginPassword.length<=0){
			alert('密码不能为空');
			return false;
		}
		if(form1.rand.value.length==0){
			alert('请输入验证码');
			return false;
		}
	}
	
</script>
<body onload="loadrand();">
	<form name="form1" action="<%=contextPath%>/adminServlet" method="post">		
        <table width="562" height="150" align="center" class="myTable">
          <tr align="center" class="tableHead">
            <td height="42" colspan="2" align="right" nowrap="nowrap" class="tableHead">后台管理登录</td>
          </tr>
          <tr>
            <td width="194" height="24" align="right" nowrap="nowrap" >用户名:</td>
            <td width="336" height="24" align="left" class="myTable"><label>
              <input name="loginname" type="text" class="text" id="loginname" />              
            </label></td>
          </tr>
          <tr>
            <td height="24" align="right" nowrap="nowrap" >密码:</td>
            <td width="336" height="24" align="left" class="myTable"><label>
              <input name="password" type="password" class="text" id="password" /></label></td>
          </tr>
          <tr>
            <td height="23" align="right">验证码:</td>
            <td height="23" align="left"><label>
              <input name="rand" type="text" class="text" id="rand" />
              <img id="code" border=0 >              
              <input name="Submit3" type="button" class="button" value="看不清?" onclick="loadrand();"/>
            </label></td>    
       
            
          </tr>
          <tr>
            <td height="23" colspan="2" align="center"><label>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
              <input name="Submit" type="submit" class="button" value="登录" onclick="return check();"/>
              </label>
              <label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
              <input name="Submit2" type="reset" class="button" value="重置" />
              <input type="hidden" name="task" value="login">
            </label></td>
          </tr>
		  </form1>
        </table>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>

⌨️ 快捷键说明

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