use of org.eclipse.jetty.plus.webapp.PlusConfiguration in project jetty.project by eclipse.
the class WSServer method createWebAppContext.
public WebAppContext createWebAppContext() throws MalformedURLException, IOException {
WebAppContext context = new WebAppContext();
context.setContextPath(this.contextPath);
context.setBaseResource(Resource.newResource(this.contextDir));
context.setAttribute("org.eclipse.jetty.websocket.jsr356", Boolean.TRUE);
// @formatter:off
context.setConfigurations(new Configuration[] { new AnnotationConfiguration(), new WebXmlConfiguration(), new WebInfConfiguration(), new PlusConfiguration(), new MetaInfConfiguration(), new FragmentConfiguration(), new EnvConfiguration() });
return context;
}
use of org.eclipse.jetty.plus.webapp.PlusConfiguration in project jetty.project by eclipse.
the class WSServer method createWebAppContext.
public WebAppContext createWebAppContext() throws MalformedURLException, IOException {
WebAppContext context = new WebAppContext();
context.setContextPath(this.contextPath);
context.setBaseResource(Resource.newResource(this.contextDir));
context.setAttribute("org.eclipse.jetty.websocket.jsr356", Boolean.TRUE);
// @formatter:off
context.setConfigurations(new Configuration[] { new AnnotationConfiguration(), new WebXmlConfiguration(), new WebInfConfiguration(), new PlusConfiguration(), new MetaInfConfiguration(), new FragmentConfiguration(), new EnvConfiguration() });
return context;
}
use of org.eclipse.jetty.plus.webapp.PlusConfiguration in project head by mifos.
the class WorkspaceServerLauncher method createWebAppContext.
@Override
protected WebAppContext createWebAppContext() throws Exception {
final WebContextWithServletContextResourceExtension webAppContext;
webAppContext = new WebContextWithServletContextResourceExtension(null, "/" + getContext());
final ResourceCollection baseResources = baseResources();
if (baseResources != null) {
// This is if a web.xml
webAppContext.setBaseResource(baseResources);
} else {
// This is if there is no web.xml, only META-INF/resources & web-fragment.xml
final File tempFileDir = File.createTempFile("jetty-empty-context", Long.toString(System.nanoTime()));
IO.delete(tempFileDir);
tempFileDir.mkdirs();
tempFileDir.deleteOnExit();
webAppContext.setBaseResource(Resource.newResource(tempFileDir.toURI()));
}
webAppContext.replaceConfiguration(MetaInfConfiguration.class, new MetaInfFolderConfiguration());
webAppContext.replaceConfiguration(FragmentConfiguration.class, new FragmentFolderConfiguration());
webAppContext.replaceConfiguration(WebInfConfiguration.class, new WebInfFolderExtendedConfiguration());
//For JNDI
webAppContext.addConfiguration(new PlusConfiguration());
webAppContext.addConfiguration(new EnvConfiguration());
// This will make EVERYTHING on the classpath be
// scanned for META-INF/resources and web-fragment.xml - great for dev!
// NOTE: Several patterns can be listed, separate by comma
webAppContext.setAttribute(WebInfConfiguration.CONTAINER_JAR_PATTERN, ".*");
webAppContext.setAttribute(WebInfConfiguration.WEBINF_JAR_PATTERN, ".*");
// Needed for http://mifosforge.jira.com/browse/MIFOS-4918
File tmp = new File("./targetEclipse/jetty-work");
IO.delete(tmp);
tmp.mkdirs();
webAppContext.setTempDirectory(tmp);
return webAppContext;
}
Aggregations