code: public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
          // First delegate to wicket, at last resort serve 404 error
          wickFilter.doFilter(req, res, new FilterChain() {
  
              public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException {
                  if (!response.isCommitted()) {
                      if (response instanceof HttpServletResponse) {
                          response.reset();
                          ((HttpServletResponse) response).sendError(404);
                      }
                  }
              }
          });
      }
docs: {@inheritDoc}