1 //规定了Filter负责拦截所有的用户请求的过滤范围。 2 3 long before = System.currentTimeMillis(); .......... long after = System.currentTimeMillis(); 4 5 6 7 //将请求强制转换为HttpServletRequest型再赋给HttpServletRequest 请求对象hrequest 8 9 HttpServletRequest hrequest = (HttpServletRequest) request ; 10 11 12 13 //通过getServletPath()函数打印Filter 已经拦截到用户的请求的地址 14 15 System.out.println("Filter 已经拦截到用户的请求的地址: " + hrequest.getServletPath());