Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3799

simplify spring boot integration for websockets

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.5.0
    • Fix Version/s: 8.5.1
    • Component/s: ZK Update Engine
    • Security Level: Jimmy
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.5.1 R1

      Description

      due to a different startup sequence between a classic webserver and a spring boot app the configuration of servlets/filters currently fails during startup
      This happens for CometAsyncServlet and WebSocketFilter.

      With CometAsyncServlet it is possible to prevent ZK from initializing by setting a context attribute during ServletContextInitializer#onStartup:

      @SpringBootApplication
      public class Application implements ServletContextInitializer {
          @Override
          public void onStartup(ServletContext servletContext) throws ServletException {
              //required to avoid duplicate installing of the CometAsyncServlet
              //startup sequence in spring boot is different to a normal servlet webapp
              servletContext.setAttribute("org.zkoss.zkmax.ui.comet.async.installed", true);
              //servletContext.setAttribute("org.zkoss.zkmax.websocket.filter.installed", true);
          }
      

      If something similar was awailable for the WebSocketFilter it would greatly simplify the current Spring boot integration prototype.

      In the long run it would be nice if there was no such problem at all and servlets/filters are configured with standard config files, e.g. web-fragment or in web.xml

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              DevChu DevChu
              Reporter:
              cor3000 cor3000
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h