Regex context at ContextHandler?

I am trying to use a subscript context configuration (the configuration is located in $ JETTY_HOME / context /). I am trying to configure ContextHandlerwhich is responsible for serving static files as one ine javadoc.xml. My configuration files are as follows:

<?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>

I want you to have access to any path, for example / * / html /, but this is not an answer to calls like / foo / html.

How can I configure the server path as / foo / html / bar / html / baz / html? If I set the context path, for example

<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 !  -->
+4
source share

All Articles