至于串行过滤器有什么作用,我实在不知。我的理解是它只是说明 过滤器的串行运行方式

需求:当用户没有登录访问更新页面的时候,跳转到登录页面

1.登录页面:login.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!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>Insert title here</title>
</head>
<body>
<form action="UserLoginServlet" method="post">
    username:<input type="text" value="<%=null == request.getAttribute("username")?"" : request.getAttribute("username") %>" name="username"><br>
    password:<input type="text" name="password"><br>
    
    authority:<select  name="authority">
    
        <option value="1" <%="1".equals(request.getAttribute("authority"))?"selected = selected" : "" %>>common user</option>
        <option value="2" <%="2".equals(request.getAttribute("authority"))?"selected = selected" : "" %>>adminstrator</option>
    </select>
    <br>
    <input type="submit">
</form>

</body>
</html>
login.jsp

相关文章:

  • 2021-04-18
  • 2022-01-06
  • 2022-03-01
  • 2021-11-20
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
相关资源
相似解决方案