本文整理匯總了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();
}
}
示例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();
}
}
示例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;
}