本文整理汇总了Java中org.apache.tomcat.websocket.server.WsContextListener类的典型用法代码示例。如果您正苦于以下问题:Java WsContextListener类的具体用法?Java WsContextListener怎么用?Java WsContextListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WsContextListener类属于org.apache.tomcat.websocket.server包,在下文中一共展示了WsContextListener类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: deployConfig
import org.apache.tomcat.websocket.server.WsContextListener; //导入依赖的package包/类
@Override
public void deployConfig(WebApplicationContext wac, Filter... filters) {
Assert.state(this.port != -1, "setup() was never called.");
this.context = this.tomcatServer.addContext("", System.getProperty("java.io.tmpdir"));
this.context.addApplicationListener(WsContextListener.class.getName());
Tomcat.addServlet(this.context, "dispatcherServlet", new DispatcherServlet(wac)).setAsyncSupported(true);
this.context.addServletMapping("/", "dispatcherServlet");
for (Filter filter : filters) {
FilterDef filterDef = new FilterDef();
filterDef.setFilterName(filter.getClass().getName());
filterDef.setFilter(filter);
filterDef.setAsyncSupported("true");
this.context.addFilterDef(filterDef);
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(filter.getClass().getName());
filterMap.addURLPattern("/*");
filterMap.setDispatcher("REQUEST,FORWARD,INCLUDE,ASYNC");
this.context.addFilterMap(filterMap);
}
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:21,代码来源:TomcatWebSocketTestServer.java
示例2: configureContext
import org.apache.tomcat.websocket.server.WsContextListener; //导入依赖的package包/类
@Override
protected void configureContext(Context context, ServletContextInitializer[] servletContextInits) {
context.setCookies(true);
context.setDistributable(true);
context.setIgnoreAnnotations(true);
context.setTldValidation(true);
context.setUseHttpOnly(false);
context.setXmlNamespaceAware(true);
context.setXmlValidation(true);
context.addApplicationListener(WsContextListener.class.getName());
((StandardContext) context).setWorkDir(this.workDir.getAbsolutePath());
super.configureContext(context, ArrayUtils.add(servletContextInits, 0, new SdcctSessionConfigServletContextInitializer()));
}
开发者ID:esacinc,项目名称:sdcct,代码行数:17,代码来源:SdcctTomcatEmbeddedServletContainerFactory.java
示例3: deployConfig
import org.apache.tomcat.websocket.server.WsContextListener; //导入依赖的package包/类
public void deployConfig(Class<? extends WebApplicationInitializer>... initializers) {
this.context = this.tomcatServer.addContext("", System.getProperty("java.io.tmpdir"));
// Add Tomcat's DefaultServlet
Wrapper defaultServlet = this.context.createWrapper();
defaultServlet.setName("default");
defaultServlet.setServletClass("org.apache.catalina.servlets.DefaultServlet");
this.context.addChild(defaultServlet);
// Ensure WebSocket support
this.context.addApplicationListener(WsContextListener.class.getName());
this.context.addServletContainerInitializer(
new SpringServletContainerInitializer(), new HashSet<Class<?>>(Arrays.asList(initializers)));
}
开发者ID:bjornharvold,项目名称:bearchoke,代码行数:17,代码来源:TomcatWebSocketTestServer.java
注:本文中的org.apache.tomcat.websocket.server.WsContextListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论