org.mortbay.jetty.webapp.WebAppContext.setBaseResource()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中org.mortbay.jetty.webapp.WebAppContext.setBaseResource()方法的一些代码示例,展示了WebAppContext.setBaseResource()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebAppContext.setBaseResource()方法的具体详情如下:
包路径:org.mortbay.jetty.webapp.WebAppContext
类名称:WebAppContext
方法名:setBaseResource

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);

相关文章

WebAppContext类方法