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