我在Tomcat 8中运行了我的servlet,并在IIS 8中提供了一些静态文件。
可以通过http://localhost/myServlet/访问我的servlet ... 可以通过http://localhost/ ...
检索静态文件我的IIS配置中有以下设置。
<add name="BonCode-Tomcat-WC-Handler" path="/myServlet/*" verb="*" type="BonCodeIIS.BonCodeCallHandler"
resourceType="Unspecified" requireAccess="None" preCondition="integratedMode" />
<add name="BonCode-Tomcat-JSP-Handler" path="*.jsp" verb="*"
type="BonCodeIIS.BonCodeCallHandler" preCondition="integratedMode" />
但是,servlet中还有一些静态文件。
如果我将图像直接放在servlet下面, 我可以通过以下链接访问静态文件:http://localhost/myServlet/myImage.jpg。
如果我将图片放入子文件夹调用&#34;图像&#34; (文件夹路径应该类似于[servelt] /images/myImage.jpg),我无法通过此链接访问静态文件:http://localhost/myServlet/images/myImage.jpg。
如果我将path="/myServlet/*/*"
添加到配置中,请执行以下操作:
<add name="BonCode-Tomcat-WC-Handler" path="/myServlet/*/*" verb="*" type="BonCodeIIS.BonCodeCallHandler"
resourceType="Unspecified" requireAccess="None" preCondition="integratedMode" />
然后我可以通过以下链接访问静态文件:http://localhost/myServlet/images/myImage.jpg。
所以我的问题是:
"/myServlet/*"
不包含此案例"/myServlet/*/*"
?path="/myServlet/*/*/*"
?我猜
应该有更好的方法处理这个。