Maven Jetty 7 & static resources

1.8k views Asked by At

I would like to change our infrastructure to take benefits of Jetty and rapid application development.

Shortly I would like to serve static content. I found such an explanation at Jetty documentation.

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

What is the maven equivalent of the the configuration above?

Thanks

1

There are 1 answers

0
Ozgur On BEST ANSWER
  <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>