如何在Jetty7中的webapplication之外的目录中提供静态内容

时间:2015-11-20 19:01:45

标签: jetty

我试图提供静态内容,例如来自我的Web应用程序目录之外的unix服务器上的目录的pdf文件。我试过以下但是当我尝试访问它时我得到了404。我在jetty.xml中将其定义如下

            <Item>
                    <New class="org.eclipse.jetty.server.handler.ContextHandler">
                    <Set name="contextPath">/test</Set>
                    <Set name="handler">
                        <New class="org.eclipse.jetty.server.handler.ResourceHandler">
                            <Set name="directoriesListed">true</Set>
                            <Set name="resourceBase">/data/muni/data/AlaBAMa/muMCVClient</Set>
                                                       </New>
                    </Set>
                </New>
            </Item>

/data/muni/data/AlaBAMa/muMCVClient是我的pdf文件所在服务器的路径。但是当我尝试/test/test.pdf时,我得到了404。

非常感谢任何帮助。

0 个答案:

没有答案
相关问题