use of org.eclipse.jetty.annotations.ServletContainerInitializersStarter in project oozie by apache.
the class JspHandler method setupWebAppContext.
/**
* Setup the basic application "context" for this application at "/"
* This is also known as the handler tree (in jetty speak)
* @param servletContextHandler the context handler
* @throws IOException in case of IO errors
* @throws URISyntaxException if the server URI is not well formatted
*/
public void setupWebAppContext(WebAppContext servletContextHandler) throws IOException, URISyntaxException {
Preconditions.checkNotNull(servletContextHandler, "servletContextHandler is null");
File scratchDir = getScratchDir();
servletContextHandler.setAttribute("javax.servlet.context.tempdir", scratchDir);
servletContextHandler.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", ".*/[^/]*servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/.*taglibs.*\\.jar$");
URI baseUri = webRootResourceLocator.getWebRootResourceUri();
servletContextHandler.setResourceBase(baseUri.toASCIIString());
servletContextHandler.setAttribute("org.eclipse.jetty.containerInitializers", jspInitializers());
servletContextHandler.addBean(new ServletContainerInitializersStarter(servletContextHandler), true);
servletContextHandler.setClassLoader(getUrlClassLoader());
servletContextHandler.addServlet(jspServletHolder(), "*.jsp");
servletContextHandler.addServlet(jspFileMappedServletHolder(), "/oozie/");
servletContextHandler.addServlet(defaultServletHolder(baseUri), "/");
}
Aggregations