zoukankan      html  css  js  c++  java
  • 设备资源管理系统-过滤器

    设备资源管理系统-过滤器

    •   添加过滤器

      操作:

          1、创建一个类CheckLogonUserFilter,实现javax.servlet.Filter

          2、获得方法:

               public void init(FilterConfig arg0) throws ServletException {

                 1)初始化不能被过滤的连接(存放到List对象中)

               }

               public void doFilter(ServletRequest arg0, ServletResponse arg1,   FilterChain arg2) throws IOException, ServletException {

                 1)获取当前操作的所有连接,与初始化中的不能被过滤的连接进行对比,如果不包含不被过滤的连接,则不能放行,跳转到首页面

                 2)从request中获取session,从session中再获取当前登录的用户信息,判断用户是否为空,如果为空,跳转到首页面

           }

           public void destroy() {

           }

    在Web.xml中添加过滤器

  • 相关阅读:
    ==和===
    Println、Printf、Sprintf区别
    BurpSuite代理https
    scp
    Tomcat Ajp(CVE-2020-1938)
    Chrome-HackBar破解
    crontab
    Sql注入之postgresql
    Sql注入之oracle
    LeetCode简单题(一)
  • 原文地址:https://www.cnblogs.com/yangml/p/3819217.html
Copyright © 2011-2022 走看看