📄 login.jsp~39~
字号:
<%@ page contentType="text/html; charset=GB2312" %>
<%@ page errorPage="login_error.jsp" %>
<%@ page session="true" %>
<jsp:useBean id="loginBeanId" scope="page" class="bookmanager.LoginBean" />
<jsp:setProperty name="loginBeanId" property="*" />
<%
if( request.getParameter("username")!=null && !request.getParameter("username").equals("")){
String username =request.getParameter("username");
String password =request.getParameter("password");
//String authority1 = request.getParameter("authority");
String msc=null;
String log;
//int authority=Integer.parseInt(authority1.trim());
username = new String(username.getBytes("ISO8859-1"));
password = new String(password.getBytes("ISO8859-1"));
loginBeanId.setUsername(username);
//loginBeanId.setAuthority(authority);
loginBeanId.setPassword(password);
msc=loginBeanId.execute().trim();
if(msc.equals("allowed")){
session.setAttribute("username",username);
String uid = Long.toString(loginBeanId.getUid());
String name=loginBeanId.getName().trim();
String authority=loginBeanId.getAuthority();
session.setAttribute("uid",uid);
//session.setAttribute("name",name);
//session.setAttribute("authority",authority);
log="1";
session.setAttribute("log",log);
//response.sendRedirect("welcome.jsp");
response.sendRedirect("go.jsp?&tp=login");
System.out.println(uid);
}
log="0";
if(msc.equals("none")){System.out.println("none");
%>
<script language="javascript">
alert("该用户不存在!请核查.......");
</script>
<%
response.sendRedirect("index.jsp");
}
if(msc.equals("fail")){System.out.println("fail");
%>
<script language="javascript">
alert("系统出错!请稍候再试.....");
</script>
<%
response.sendRedirect("index.html");
}
if(msc.equals("error")){System.out.println("error");
%>
<script language="javascript">
alert("异常出错!请稍候再试.....");
</script>
<%
response.sendRedirect("index.jsp");
}
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -