Maven Jetty 7和静态资源
-
16-11-2019 - |
题
我想改变我们的基础架构,以利用码头和快速应用开发的好处。
我不久我想服务于静态内容。我在码头文档中发现了这样的解释。
<Configure class="org.mortbay.jetty.handler.ContextHandler">
<Set name="contextPath">/static</Set>
<Set name="resourceBase">D:/LocalProjects/myproject/html/static/
</Set>
<Call name="addHandler">
<Arg>
<New class="org.mortbay.jetty.handler.ResourceHandler"/>
</Arg>
</Call>
</Configure>
.
什么是上面的配置的maven?
感谢
解决方案
<contextHandlers>
<contextHandler implementation="org.eclipse.jetty.server.handler.ContextHandler">
<contextPath>/static</contextPath>
<resourceBase>D:/LocalProjects/myproject/html/static/</resourceBase>
<handler implementation="org.eclipse.jetty.server.handler.ResourceHandler"/>
</contextHandler>
</contextHandlers>
不隶属于 StackOverflow