getPathInfo() sometimes return null. In documentation HttpServletRequest
This method returns null if there was no extra path information.
I need get path to file without context path in Filter and getPathInfo() return me null. So I use another method: httpRequest.getServletPath()
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
{
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
String newPath = parsePathToFile(httpRequest.getServletPath());
...
}