ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

javaweb实验-员工登陆系统

2022-04-06 13:03:05  阅读:139  来源: 互联网

标签:javaweb color text height width 登陆 date 员工 nbsp


1.css样式
@charset "utf-8";
body{
width:1100px;
text-align:center;
margin-left:auto;
margin-right:auto;
}
.div_01{
background-color:Aquamarine;
border:2px solid #aaaaaa;
width:1100px;
height:100px;
font-size:20pt;
line-height:100%;
}
.div_02{
text-align:left;
line-height:20pt;
padding-top:10px;
padding-bottom: 10px;
font-weight:bold;
border-bottom: solid #777777 2px;
}
.div_03{
padding-top:10px;
}

th_01{

background-color:MediumTurquoise;
width:140px;
height:60px;

}
a{
font-family:宋体;
text-align:left;
text-decoration:underline;
TEXT-DECORATION:none;
}
.td_01{
text-align:center;
}
.span_01{
color:SkyBlue;
}
.td_02{
text-align:center;
}

span_02{

width:200px;
height:20px;
background-color:Aquamarine;

}

.quan{
background-color:Cornsilk;
height:600px;

}

2.主页
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8" import="java.util.*"%>

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Insert title here</title> <title>员工登录入口</title> <meta http-equiv="pragma" content= "no-cache "> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0" > <meta htp-equiv="keywords" content="keywordl,keyword2,keyword3"> <meta hup- equiv= "ecripipio" content= "This is my page"> <link rel="stylesheet" type="text/css" href="styles.css"> <style type="text/css"> body{ width: 1100px; text-align:center; margin-left:auto; margin-right:auto; } .div_01 { background-color:LightSkyBlue; border:2px solid #aaaaaa; width: 1100px; height: 100px; font-size: 20pt; line-height: 100%; } .div_02{ background-color:LightSkyBlue; width: 1100px; height:900px; } </style> </head> <body> <div class="div_02"> <div class="div_01"> <h1>员工登录入口</h1> </div> <div class="div_02"> <form action="lmy-cl.jsp" method="post"> <br/><br/><br/> 账号:<input type="text" name="userName" placeholder="账号"><br/><br/> 密码:<input type="password" name="userPwd" placeholder="密码"><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="submit" value="登录">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="重置"><br/> </form> </div> </div> </body> </html> 3.内部系统 <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" import="java.util.*"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>员工之窗</title> <meta http-equiv="pragma" content="no-cache "> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0" > <meta htp-equiv="keywords" content="keywordl,keyword2,keyword3"> <meta hup-equiv= "ecripipio" content= "This is my page"> <link rel="stylesheet" type="text/css" href="user-css.css"> </head> <body> <div class="quan"> <div class="div_01"> <h1 >员工之窗</h1> </div> <div class="div_02"> <span class="span_01"> <%= session.getAttribute("userName")%> </span>,欢迎来到员工之窗。 <br/> 当前时间:<div id="span_02" onclick="time()"></div> </div> <div class="div_03"> <table border="1" cellspacing="0" align="center"> <tr> <th id="th_01">文章编号</th> <th id="th_01">文章类型</th> <th id="th_01">标题</th> <th id="th_01">作者</th> <th id="th_01">发表日期</th> </tr> </table><br/> <a href="${pageContext.request.contextPath}/lmy-tc.jsp">【发表文章】 </a>&nbsp;&nbsp;&nbsp; <a href="${pageContext.request.contextPath}/lmy-1.jsp">【退出登录】 </a>&nbsp;&nbsp;&nbsp; <a href="${pageContext.request.contextPath}/lmy-1.jsp">【返回首页】 </a> </div> </div> <script type= "text/javascript" > function time2(){ var date = new Date() ; var time=(date.getFullYear()+"—"+(date.getMonth()+1)+"—"+date.getDate()+""+date.getHours()+":"+ date.getMinutes()+":"+date.getSeconds()); document.getElementById("span_02").innerHTML=time; } window.setInterval(time2(),1000); </script> 4.测试 <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> Insert title here <% String userName = request.getParameter("userName"); String userPwd = request.getParameter("userPwd"); if(userName==null || userPwd==null){ //request.setAttribute(" message","账号或密码为空"); pageContext.forward("lmy-1.jsp"); } else if( userName.equals("lmy") && userPwd.equals("123")){ session.setAttribute("userName",userName) ; session.setAttribute("userPwd",userPwd); pageContext.forward("user.jsp"); //response.sendRedirect(request.getContextPath()+"user.jsp");20和21两者都可以用; }else{ //request.setAttribute(" message", "账号或密码错误"); pageContext.forward("lmy-1.jsp"); }

%>

5.退出 <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" import="java.util.*"%> 发表文章 <% if(session.getAttribute("userName")!=null){ session.invalidate(); response.sendRedirect("lmy-1"); } %>

标签:javaweb,color,text,height,width,登陆,date,员工,nbsp
来源: https://www.cnblogs.com/fzlgxy085/p/16105868.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有