Don't mix ResourceHandler and ServletContextHandler unless you *REALLY* know what you are doing.
Eg: once you enter a ServletContextHandler you are subject to all of the rules for a javax.servlet.ServletContext. You never exit a ServletContextHandler, and Filters only apply within the request chain within that ServletContext.
A sub-handler like you declared it, is NOT part of the ServletContext, or the request chain in that ServletContext.
A better approach, stay with 1 ServletContextHandler, no ResourceHandler, use the DefaultServlet instead to serve static content (its a MUCH better choice then ResourceHandler anyway).
File codeDocsDir = new File("/tmp/code-docs");
Resource codeDocsResource = Resource.newResource(codeDocsDir);
File userGuideDocsDir = new File("/tmp/user-guide-docs");
Resource userGuideDocsResource = Resource.newResource(userGuideDocsDir);
ResourceCollection resources = new ResourceCollection(codeDocsResource, userGuideDocsResource);
ServletContextHandler handler = new ServletContextHandler();
handler.setContextPath("/");
handler.setBaseResource(resources); // what static content resources are used
FilterHolder frameOptions = new FilterHolder(FRAME_OPTIONS_FILTER);
frameOptions.setName("X-Frame-Options");
handler.addFilter(frameOptions, "/*", EnumSet.allOf(DispatcherType.class));
handler.setContextPath(contextPath);
ServletHolder holderDef = new ServletHolder("default", DefaultServlet.class); // what serves the static resources
holderDef.setInitParameter("dirAllowed","false");
handler.addServlet(holderDef,"/");
return handler;