本文整理了Java中org.mortbay.jetty.webapp.WebAppContext.setBaseResource()
方法的一些代码示例,展示了WebAppContext.setBaseResource()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebAppContext.setBaseResource()
方法的具体详情如下:
包路径:org.mortbay.jetty.webapp.WebAppContext
类名称:WebAppContext
方法名:setBaseResource
暂无
代码示例来源:origin: datasalt/splout-db
public void run() throws Exception {
Server server = new Server(port);
WebAppContext context = new WebAppContext();
context.setContextPath("/");
context.addServlet(new ServletHolder(new DefaultServlet()), "/pagecounts/*");
context.addServlet(new ServletHolder(new PageCountsServlet(new SploutClient(qNodes.split(",")))), "/api");
context.addServlet(new ServletHolder(new PageCountsTrendingServlet()), "/trends");
ResourceCollection resources = new ResourceCollection(new String[]{Resource.newClassPathResource(
"pagecounts").toString()});
context.setBaseResource(resources);
server.setHandler(context);
server.start();
try {
while (true) {
Thread.sleep(5000);
}
} catch (InterruptedException e) {
e.printStackTrace();
server.stop();
}
}
代码示例来源:origin: com.github.albfernandez.test-jsf/jsf-test-jetty
private void createContext() {
webAppContext = new WebAppContext();
webAppContext.setContextPath("/");
webAppContext.setBaseResource(serverRoot);
webAppContext.setClassLoader(getClassLoader());
org.mortbay.jetty.servlet.ServletHolder defaultServletHolder =
new org.mortbay.jetty.servlet.ServletHolder(new DefaultServlet());
//defaultServletHolder.setInitParameter("aliases", Boolean.FALSE.toString());
webAppContext.addServlet(defaultServletHolder, "/");
webAppContext.addEventListener(new HttpSessionListener() {
public void sessionDestroyed(HttpSessionEvent se) {
session = null;
}
public void sessionCreated(HttpSessionEvent se) {
session = se.getSession();
}
});
}
代码示例来源:origin: org.springframework.osgi/spring-osgi-web
wac.setBaseResource(rootResource);
代码示例来源:origin: org.springframework.osgi/org.springframework.osgi.web
wac.setBaseResource(rootResource);
代码示例来源:origin: datasalt/splout-db
.newClassPathResource("panel").toString()});
context.setBaseResource(resources);
内容来源于网络,如有侵权,请联系作者删除!