当前位置: 首页>>代码示例>>Java>>正文


Java ServletHolder.setName方法代码示例

本文整理汇总了Java中org.eclipse.jetty.servlet.ServletHolder.setName方法的典型用法代码示例。如果您正苦于以下问题:Java ServletHolder.setName方法的具体用法?Java ServletHolder.setName怎么用?Java ServletHolder.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jetty.servlet.ServletHolder的用法示例。


在下文中一共展示了ServletHolder.setName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.eclipse.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    server = new Server(PORT);

    ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
    context.setContextPath("/");
    server.setHandler(context);

    servletHolder = new ServletHolder(new CamelWebSocketServlet());
    servletHolder.setName("CamelWsServlet");
    context.addServlet(servletHolder, "/*");
    
    server.start();
    
    if (startCamelContext) {        
        super.setUp();
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:WebsocketCamelRouterTestSupport.java

示例2: setUp

import org.eclipse.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    server = new Server(PORT);

    ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
    context.setContextPath("/");
    server.setHandler(context);

    servletHolder = new ServletHolder(new CamelWebSocketServlet());
    servletHolder.setName("CamelWsServlet");
    servletHolder.setInitParameter("events", "true");
    context.addServlet(servletHolder, "/*");
    
    server.start();
    
    if (startCamelContext) {        
        super.setUp();
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:WebsocketCamelRouterWithInitParamTestSupport.java

示例3: addDefaultServlet

import org.eclipse.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
/**
 * Add Jetty's {@code DefaultServlet} to the given {@link WebAppContext}.
 * @param context the jetty {@link WebAppContext}
 */
protected final void addDefaultServlet(WebAppContext context) {
	Assert.notNull(context, "Context must not be null");
	ServletHolder holder = new ServletHolder();
	holder.setName("default");
	holder.setClassName("org.eclipse.jetty.servlet.DefaultServlet");
	holder.setInitParameter("dirAllowed", "false");
	holder.setInitOrder(1);
	context.getServletHandler().addServletWithMapping(holder, "/");
	context.getServletHandler().getServletMapping("/").setDefault(true);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:JettyEmbeddedServletContainerFactory.java

示例4: addJspServlet

import org.eclipse.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
/**
 * Add Jetty's {@code JspServlet} to the given {@link WebAppContext}.
 * @param context the jetty {@link WebAppContext}
 */
protected final void addJspServlet(WebAppContext context) {
	Assert.notNull(context, "Context must not be null");
	ServletHolder holder = new ServletHolder();
	holder.setName("jsp");
	holder.setClassName(getJspServlet().getClassName());
	holder.setInitParameter("fork", "false");
	holder.setInitParameters(getJspServlet().getInitParameters());
	holder.setInitOrder(3);
	context.getServletHandler().addServlet(holder);
	ServletMapping mapping = new ServletMapping();
	mapping.setServletName("jsp");
	mapping.setPathSpecs(new String[] { "*.jsp", "*.jspx" });
	context.getServletHandler().addServletMapping(mapping);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:19,代码来源:JettyEmbeddedServletContainerFactory.java

示例5: setupRestApiContextHandler

import org.eclipse.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
private static ServletContextHandler setupRestApiContextHandler(ZeppelinConfiguration conf) {
  final ServletHolder cxfServletHolder = new ServletHolder(new CXFNonSpringJaxrsServlet());
  cxfServletHolder.setInitParameter("javax.ws.rs.Application", ZeppelinServer.class.getName());
  cxfServletHolder.setName("rest");
  cxfServletHolder.setForcedPath("rest");

  final ServletContextHandler cxfContext = new ServletContextHandler();
  cxfContext.setSessionHandler(new SessionHandler());
  cxfContext.setContextPath(conf.getServerContextPath());
  cxfContext.addServlet(cxfServletHolder, "/api/*");

  cxfContext.addFilter(new FilterHolder(CorsFilter.class), "/*",
      EnumSet.allOf(DispatcherType.class));
  return cxfContext;
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:16,代码来源:ZeppelinServer.java


注:本文中的org.eclipse.jetty.servlet.ServletHolder.setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。