How to implement service workers with a JSP page

The structure of my files is below

  • Webapp
    • resources
      • service-worker.js
    • WEB-INF
      • Views
        • app.jsp

The service user registration code is located inside the app.jsp page. which accesses the service-worker.js file. But since both service-worker.js and the registration code must be placed in parallel, so the service worker does not work.

+4
source share

Source: https://habr.com/ru/post/1692709/


All Articles