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

📄 login.jsp~32~

📁 Name: Book shop manager. 开发语言: Java
💻 JSP~32~
字号:
<%@ page contentType="text/html; charset=GB2312" %>
<%@ page errorPage="login_error.jsp" %>

<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;
   //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());
     session.setAttribute("uid",uid);
     response.sendRedirect("welcome.jsp");
     System.out.println(uid);
   }
   if(msc.equals("none")){System.out.println("none");
   %>

 <script language="javascript">
alert("该用户不存在!请核查.......");
</script>

   <%
   response.sendRedirect("index.html");
   }
   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 + -