java 过滤器链

来源:互联网 发布:c语言什么书好 编辑:程序博客网 时间:2024/06/03 19:43

在doFilter()中特别注意加入

arg2.doFilter(arg0, arg1);


另外,若想在地址栏传入参数,如:http://localhost:8080/test/index.jsp?id=1

在doFilter中取出运用request,即arg0


若想获得session,利用强制转换

HttpServletRequest request = (HttpServerletRequest)arg0;

HttpSession  session = request.getSession();

本文出自 “just2012” 博客,请务必保留此出处http://just2012.blog.51cto.com/7435167/1348414

0 0
原创粉丝点击