Tomcat 9制作PreResources配置递归目录

时间:2019-06-05 20:07:23

标签: tomcat tomcat9

我正在使用Tomcat 9.0.12版

我的context.xml中有一个PreResources标记,如下所示:

  <Resources className="org.apache.catalina.webresources.StandardRoot"> 
      <PreResources 
          className="org.apache.catalina.webresources.DirResourceSet" 
          base="C:\\good_files\\goodies_in_here" 
          internalPath="/" 
          webAppMount="/" 
      /> 
  </Resources> 

这很有用,因为如果我访问这样的JSP:

http://localhost:8080/candy/chocolate.jsp

我可以毫无问题地访问JSP。但是,C:\ good_files \ goodies_in_here中有子目录。如果我尝试访问子目录中的JSP:

http://localhost:8080/candy/crunchy/peanut_brittle.jsp

即使文件C:\ good_files \ goodies_in_here \ crunchy \ banana_brittle.jsp存在,我也得到404。我必须为树中的每个子目录创建一个PreResources标记吗?

0 个答案:

没有答案
相关问题