没有resourceBase的Jetty配置 [英] Jetty config without resourceBase

查看:405
本文介绍了没有resourceBase的Jetty配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有Jetty的Scalatra,目前正在提供REST API.完全没有静态上下文.但是,似乎我无法不获得

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?

推荐答案

resourceBase是必需的,它不仅用于静态内容.

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

这也是ServletContext所需的配置位置.

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

如果没有,请将其指向jar文件中的空目录.

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

这篇关于没有resourceBase的Jetty配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆