use of org.nuxeo.ecm.webengine.app.WebEngineFilter in project nuxeo-filesystem-connectors by nuxeo.
the class WebDavServerFeature method setUpTomcat.
protected void setUpTomcat() throws Exception {
tomcat = new Tomcat();
// for tmp dir
tomcat.setBaseDir(".");
tomcat.setHostname(HOST);
tomcat.setPort(PORT);
ProtocolHandler p = tomcat.getConnector().getProtocolHandler();
AbstractEndpoint<?> endpoint = (AbstractEndpoint<?>) getFieldValue(p, "endpoint");
// vital for clean shutdown
endpoint.setMaxKeepAliveRequests(1);
File docBase = new File(".");
Context context = tomcat.addContext(CONTEXT, docBase.getAbsolutePath());
Application app = new org.nuxeo.ecm.webdav.Application();
ApplicationAdapter conf = new ApplicationAdapter(app);
conf.getFeatures().put(ResourceConfig.FEATURE_MATCH_MATRIX_PARAMS, Boolean.TRUE);
String servletName = "testServlet";
Servlet servlet = new ServletContainer(conf);
tomcat.addServlet(CONTEXT, servletName, servlet);
context.addServletMappingDecoded("/*", servletName);
addFilter(context, servletName, "RequestContextFilter", new RequestContextFilter());
addFilter(context, servletName, "SessionCleanupFilter", new SessionCleanupFilter());
addFilter(context, servletName, "NuxeoAuthenticationFilter", new NuxeoAuthenticationFilter());
addFilter(context, servletName, "WebEngineFilter", new WebEngineFilter());
tomcat.start();
}
Aggregations