过滤器Filter中得到各种路径

 

 

init()方法中:

  filterConfig.getServletContext():
  filterConfig.getServletContext().getRealPath("/"):
  filterConfig.getServletContext().getRealPath("/admin"):

 

 

 

 

doFilter()方法中:

  HttpServletRequest request = (HttpServletRequest) servletRequest;
  HttpServletResponse response = (HttpServletResponse) servletResponse;

之后:

request.getContextPath():

你可能感兴趣的:(JavaEE)