1.Filter是通过实现Filter接口实现的,重写方法
①init是开始过滤
②destroy是结束过滤
③doFilter是执行过滤
(ServletRequest req, ServletResponse resp, FilterChain chain)
chain.doFilter(req, resp);(doFilter中的自有代码,提交)
2.多个Filter的执行顺序
xml配置按照顺序
注解配置就按照编码顺序(数字大于英文,大写大于小于)
注解中写多个对象触发urlPatterns = {"/*","/*.jsp"}
3.获取(HttpServletRequest)的request对象
将ServletRequest req强转为HttpServletRequest request类型
获取当前的url地址:String url = request.getRequestURI();
4.创建Listener要实现HttpSessionAttributeListener
ServletContextListener,HttpSessionListener,ServletRequestListener
值的改变加Attribute
5.
HttpSessionBindingListener是绑定值和解除值的接口
HttpSessionActivationListener是钝化和激活的接口
6.