processlogin.jsp
来自「07年做得人力资源管理系统」· JSP 代码 · 共 70 行
JSP
70 行
<%@ page language="java" import="com.buat.hr.users.User,com.buat.hr.users.UserDao,java.util.ArrayList" pageEncoding="GB18030"%>
<%
UserDao udao=new UserDao();
User user=null;
String username=null;
String pw=null;
username=request.getParameter("username");
pw=request.getParameter("pw");
if(username.length() == 0 && pw.length() == 0){
%>
<SCRIPT LANGUAGE="JavaScript">
window.alert("用户名和密码都不能为空!")
window.location.href("Login.jsp");
</script>
<%
}
if(username.length() == 0){
%>
<SCRIPT LANGUAGE="JavaScript">
window.alert("用户名不能为空!")
window.location.href("Login.jsp");
</script>
<%
}
if(pw.length() == 0){
%>
<SCRIPT LANGUAGE="JavaScript">
window.alert("密码不能为空!")
window.location.href("Login.jsp");
</script>
<%
}
user=new User(username,pw);
%>
<html>
<head>
<title></title>
</head>
<body background="../bg.jpg">
<center>
<%
user=udao.queryUser(username,user);
// System.out.println(user.getIsadmin());
if(user.getMassage().equals("登录成功!!!")){
session.setAttribute("userGrade",user);
%>
<script type="text/javascript">
window.alert("<%=user.getMassage()%>");
window.location.href("../frame/Frame.jsp");
</script>
<%
}else{
%>
<script type="text/javascript">
window.alert("<%=user.getMassage()%>");
window.location.href("Login.jsp");
</script>
<%
}
%>
</center>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?