Monday, 15 March 2010

java - Serve static content on Jetty, that are resources on WEB-INF/lib libraries? -



java - Serve static content on Jetty, that are resources on WEB-INF/lib libraries? -

for project i'm working on (using jetty 9), i'm interested in setting defaultservlet on web.xml , serve static content. particularity want deploy war file, packages modules of application in individual jars included in /web-inf/lib. on 1 of these jars packaging static content resource directory, should configured base of operations of files defaultservlet on war's webxml.

so far have in war's 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 war, web-inf/lib/dashboard.jar's construction is:

/ /static/index.html /meta-inf

ideally access /dashboard/index.html

i know next config wrong, transmits think should possible, i.e. set base of operations of content served of defaultservlet "classpath path", embedded in 1 of war's jar...

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

any experts out there can provide hint on how can work ?

thanks

java servlets jar jetty war

No comments:

Post a Comment