Embedded Jetty resourceBase classpath URL

Posted by drewzilla on Stack Overflow See other posts from Stack Overflow or by drewzilla
Published on 2010-05-14T08:38:27Z Indexed on 2010/05/14 8:44 UTC
Read the original article Hit count: 330

Filed under:
|
|

I'm embedding Jetty in a Spring based application. I configure my Jetty server in a Spring context file. The specific part of the configuration I'm having trouble with is this:

<bean class="org.eclipse.jetty.webapp.WebAppContext">
   <property name="contextPath" value="/" />
   <property name="resourceBase" value="????????" />
   <property name="parentLoaderPriority" value="true" />
</bean>

If you see above, where I've put the ????????, I ideally want the resourceBase to reference a folder on my classpath. I'm deploying my application in a single executable JAR file and have a folder config/web/WEB-INF on my classpath.

Jetty seems to be able to handle URLs defined in the resourceBase (e.g. jar:file:/myapp.jar!/config/web) but it doesn't seem to support classpath URLs. I get an IllegalArgumentException if I define something like classpath:config/web.

This is a real pain for me. Does anyone know of anyway to achieve this functionality?

Thanks,

Andrew

© Stack Overflow or respective owner

Related posts about embedded-jetty

Related posts about jetty