【发布时间】:2014-10-07 17:02:46
【问题描述】:
我尝试通过this tutorial 启动 Jersey + Jetty + Nginx,但我无法使用 war 文件。如何启动我的 java 应用程序?
我通过右键单击 BackendServer.java 并在 IDEA 中单击“运行”或在终端 java -cp /home/example/backend/build/WEB-INF/lib/backend.jar:/home/example/backend/libs/* com.example.backend.BackendServer 中使用来启动应用程序。
项目结构描述here.
/opt/jetty/webapps/backend.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC
"-//Mort Bay Consulting//DTD Configure//EN"
"http://www.eclipse.org/jetty/configure_9_0.dtd">
<!--
Configure a custom context for serving javadoc as static resources
-->
<Configure class="org.eclipse.jetty.server.handler.ContextHandler">
<Set name="contextPath">/</Set>
<Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>??????????</Set>
<Set name="handler">
<New class="org.eclipse.jetty.server.handler.ResourceHandler">
<Set name="welcomeFiles">
<Array type="String">
<Item>index.html</Item>
</Array>
</Set>
<Set name="cacheControl">max-age=3600,public</Set>
</New>
</Set>
</Configure>
应该用什么代替????????我应该在 BackendServer.java 中使用嵌入式码头吗?我知道我有从 nginx 到码头的重定向请求,但我不明白如何使用码头启动球衣应用程序......
【问题讨论】:
标签: java nginx jersey jetty war