flexible/java-17/websocket-jetty/src/main/java/com/example/flexible/websocket/jettynative/Main.java [42:76]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public static void main(String[] args) throws Exception {

    // Create a server that listens on port 8080.
    Server server = new Server(8080);
    WebAppContext webAppContext = new WebAppContext();
    server.setHandler(webAppContext);

    // Load static content from inside the jar file.
    URL webAppDir = Main.class.getClassLoader().getResource("WEB-INF/");
    System.out.println(webAppDir);
    webAppContext.setResourceBase(webAppDir.toURI().toString());

    // Enable annotations so the server sees classes annotated with @WebServlet.
    webAppContext.setConfigurations(
        new Configuration[] {
          new AnnotationConfiguration(), new WebInfConfiguration(),
        });

    webAppContext.setAttribute(
        "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
        ".*/target/classes/|.*\\.jar");
    enableEmbeddedJspSupport(webAppContext);

    ServletHolder holderAltMapping = new ServletHolder();
    holderAltMapping.setName("index.jsp");
    holderAltMapping.setForcedPath("/index.jsp");
    webAppContext.addServlet(holderAltMapping, "/");

    // Start the server! 🚀
    server.start();
    System.out.println("Server started!");

    // Keep the main thread alive while the server is running.
    server.join();
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



flexible/java-11/websocket-jetty/src/main/java/com/example/flexible/websocket/jettynative/Main.java [42:76]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public static void main(String[] args) throws Exception {

    // Create a server that listens on port 8080.
    Server server = new Server(8080);
    WebAppContext webAppContext = new WebAppContext();
    server.setHandler(webAppContext);

    // Load static content from inside the jar file.
    URL webAppDir = Main.class.getClassLoader().getResource("WEB-INF/");
    System.out.println(webAppDir);
    webAppContext.setResourceBase(webAppDir.toURI().toString());

    // Enable annotations so the server sees classes annotated with @WebServlet.
    webAppContext.setConfigurations(
        new Configuration[] {
          new AnnotationConfiguration(), new WebInfConfiguration(),
        });

    webAppContext.setAttribute(
        "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
        ".*/target/classes/|.*\\.jar");
    enableEmbeddedJspSupport(webAppContext);

    ServletHolder holderAltMapping = new ServletHolder();
    holderAltMapping.setName("index.jsp");
    holderAltMapping.setForcedPath("/index.jsp");
    webAppContext.addServlet(holderAltMapping, "/");

    // Start the server! 🚀
    server.start();
    System.out.println("Server started!");

    // Keep the main thread alive while the server is running.
    server.join();
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



