tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1516426 - /tomcat/trunk/java/org/apache/tomcat/websocket/server/WsListener.java
Date Thu, 22 Aug 2013 12:08:37 GMT
Author: markt
Date: Thu Aug 22 12:08:37 2013
New Revision: 1516426

URL: http://svn.apache.org/r1516426
Log:
Have the WsListener check for a WebSocket Server Container before it triggers initialization
of the WsSCI in case the SCI has been detected by the container.

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/server/WsListener.java

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsListener.java?rev=1516426&r1=1516425&r2=1516426&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsListener.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsListener.java Thu Aug 22 12:08:37
2013
@@ -16,6 +16,7 @@
  */
 package org.apache.tomcat.websocket.server;
 
+import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
 
@@ -30,7 +31,12 @@ public class WsListener implements Servl
 
     @Override
     public void contextInitialized(ServletContextEvent sce) {
-        WsSci.init(sce.getServletContext());
+        ServletContext sc = sce.getServletContext();
+        // Don't trigger WebSocket initialization if a WebSocket Server
+        // Container is already present
+        if (sc.getAttribute(Constants.SERVER_CONTAINER_SERVLET_CONTEXT_ATTRIBUTE) == null)
{
+            WsSci.init(sce.getServletContext());
+        }
     }
 
     @Override



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message