Jetty config without resourceBase

2019-09-04 08:21发布

问题:

I have a Scalatra with Jetty and it is serving REST API at the moment. No static context served at all. However, it seems I cannot skip setting resourceBase without getting

java.lang.IllegalStateException: No resourceBase or war set for context

Do I have to point it to some empty directory or is there some other option?

回答1:

A resourceBase is required, and it is used for more than just static content.

It's also the location for configuration that the ServletContext needs.

Point it at an empty directory in your jar file if you don't even have that.