我正在尝试使用jetty上下文配置(配置放在$ JETTY_HOME / context /中) . 我正在尝试配置一个负责提供静态文件的 ContextHandler 作为一个ine javadoc.xml . 我的配置文件是这样的:

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.eclipse.org/configure.dtd">

<!--
Configure a custom context for serving javadoc as static resources 
-->

<Configure class="org.eclipse.jetty.server.handler.ContextHandler">
  <Set name="contextPath">/*/html</Set>

  <Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/html/</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>

我想要的是能够服务于/ * / html /之类的任何路径,但这不会响应像/ foo / html这样的调用 .

如何配置服务器的路径,如/ foo / html / bar / html / baz / html?如果我设置上下文路径

<Set name="contextPath">/foo/html</Set><!--this one works  -->
<Set name="contextPath">/bar/html</Set> <!-- this one works  -->

<Set name="contextPath">/baz/html</Set> <!-- this one works  -->

<Set name="contextPath">/*/html</Set> <!-- this one does not !  -->