check_login.jsp

来自「一个超市管理系统,提供一些基本简单的操作,JSP+APACHE+ORCALE实现」· JSP 代码 · 共 19 行

JSP
19
字号
<%
String name=request.getParameter("name");
String password=request.getParameter("password");
String type=request.getParameter("type");
//检查用户登录是否成功,这里假设用户名为hellking就表示登录成功,
//用户的验证通常通过连接数据库或者使用role来进行。
if(name.equals("hellking"))
{
   session.setAttribute("name",name);
   session.setAttribute("type",type);
   response.sendRedirect("loginsucess.jsp");
}
else
{
 response.sendRedirect("session_login.html");
}
 %>
  

⌨️ 快捷键说明

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