Installing the WebSocket Extension on Tomcat got much easier


#1

FYI: I was able to get the SessionInitializerFilter into the code base of Tomcat 9, 8.5, 8, and 7: https://github.com/apache/tomcat/commit/44aa9d80f3a09ad30bbc34d45f29a2f7c8a7b7dc

This means that installing the Lucee WebSocket Extension in future versions of Tomcat (9.0 official release, 8.5.24, 8.0.48, 7.0.83 or later) will be much easier, because the filter is now deployed with Tomcat and there is no need to add an external jar file for it.

To configure the filter simply add the following snippet to your web.xml deployment descriptor:

<!-- Required for the Lucee WebSocket Extension !-->    
<filter>
  <filter-name>SessionInitializerFilter</filter-name>
  <filter-class>org.apache.catalina.filters.SessionInitializerFilter</filter-class>
</filter>

<filter-mapping>
  <filter-name>SessionInitializerFilter</filter-name>
  <!-- modify url-pattern to match your websocket endpoint !-->
  <url-pattern>/ws/*</url-pattern>
</filter-mapping>

Websockets install failing for 2.x versions
#2

That’s awesome work!