[英]Restlet + Embedded jetty + webapp
Just wondering if this setup is possible: 只想知道是否可以进行此设置:
I know that Restlet can serve a role of HTTP server via jetty connector, but this is not really what I need. 我知道Restlet可以通过码头连接器充当HTTP服务器的角色,但这并不是我真正需要的。 What I want is servlet container (embedded jetty) run from java application and exposing two web applications: RESTful API and webapp client. 我想要的是从Java应用程序运行的servlet容器(嵌入式码头),并公开了两个Web应用程序:RESTful API和webapp客户端。
Ok, so for my case it turned out that it's even easier than I thought. 好的,所以对于我来说,这比我想象的要容易。 It will suffice to instruct Restlet to serve some static content via this sample code : 通过以下示例代码来指示Restlet提供一些静态内容就足够了:
Directory directory = new Directory(getContext(), "file:///user/data/files/");
Router router = new Router(getContext());
router.attach("/static/", directory);
This not exactly answers my question, but it solves my problem. 这不能完全回答我的问题,但是可以解决我的问题。 As there were no more answers, I'm closing this issue. 由于没有更多答案,因此我正在关闭此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.