if (httpRequest.getPathInfo() != null && (httpRequest.getPathInfo().startsWith("/action/") || httpRequest .getPathInfo().startsWith("/template/"))) {
if (checkIfShouldHandle(httpRequest)) {
    public void doFilter(ServletRequest request, ServletResponse response,            FilterChain filterChain) throws IOException, ServletException {        if (request instanceof HttpServletRequest) {            HttpServletRequest httpRequest = (HttpServletRequest) request;            /*             * ensure we only get activated for requests that were kicked off             * from submits, etc             *              * Note: a request can also be for images, JavaScript, CSS files,             * etc, so we have to be careful to only deal with appropriate             * multiple requests             *               */            if (httpRequest.getPathInfo() != null                    && (httpRequest.getPathInfo().startsWith("/action/") || httpRequest                            .getPathInfo().startsWith("/template/"))) {                handleRequest(request, response, filterChain, httpRequest);                return;            }        }        // just call the next filter in the chain        filterChain.doFilter(request, response);    }