Tomcat Context - server.xml - how to serve static files from network location folder

时间:2016-10-13 06:52:45

标签: java tomcat servlets

I'm Running projects on a localhost Tomcat container, since the resource folder (images) are located on a network location folder (server reachable in my current network), I was wondering if it's possible to include this as a Tomcat docBase on the server.xml configuration file.

As the live environments are mounted under 1 host, I'm seeking a solution for localhost 'quick' testing.

Till now I have always been serving static content (including web pages) from outside of the 'WAR' using the Apache docBase tag (but these were locations on the same 'drive'):

<Context docBase="[ip]/folder" path="/files" />

Can anybody point me in a direction in serving static content from another host [ip] (network reachable location)?

I know there are other implementations as serving the contents through a servlet, but if possible I want to prevent servlets serving resources.

Thanks in advance.

1 个答案:

答案 0 :(得分:0)

您可以在此处安装该远程位置,并将这些文件作为此计算机上的文件提供服务。