我有 ABC.action 调用过滤器类的 doFilter 方法,该方法在 web.xml 中正确配置
我需要从请求对象中找到动作名称。我怎样才能做到这一点?
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
throws IOException, ServletException {
long t1 = System.nanoTime();
filterChain.doFilter(request, response);
long t2 = System.nanoTime();
long time = t2 - t1;
// Just writing statistics to servlet's log
System.out.println("## " +
"ArriveTime ns " + t1 + " Departtime ns " + t2 + " ServiceTime : " + time);
// System.out.println("Time taken to process request to "
// + ((HttpServletRequest) request).getRequestURI()
// + ": " + totalTime + " ms.");
}