Submit static content to Jetty, which are resources in the WEB-INF / lib libraries?

For the project I'm working on (using Jetty 9), I'm interested in setting DefaultServlet on web.xml and serving static content. The peculiarity is that I want to deploy a war file, which itself supplies the application modules to separate banks, which are included in / WEB -INF / lib. On one of these mailboxes I am packing a catalog of static content resources, which should be configured as a file base for DefaultServlet in the WAR webxml.

While I have it in my WAR WEB-INF / web.xml

 <servlet>
        <servlet-name>dashboard</servlet-name>
        <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
        <init-param>
            <param-name>org.eclipse.jetty.servlet.Default.resourceBase</param-name>
            <param-value>classpath:/static/</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>dashboard</servlet-name>
        <url-pattern>/dashboard</url-pattern>
    </servlet-mapping>
</servlet>

Inside the WAR structure, WEB-INF / lib / dashboard.jar:

/
/static/index.html
/META-INF

Ideally, I would like to access /dashboard/index.html

, , , , , .. , DefaultServlet, " ", WAR...

        <init-param>
            <param-name>org.eclipse.jetty.servlet.Default.resourceBase</param-name>
            <param-value>classpath:/static/</param-value>
        </init-param>

, , ?

+4

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


All Articles