<分区>
我正在尝试从 weblogic 迁移到 tomcat。 在 weblogic 中我有
<virtual-directory-mapping>
<local-path>E:/internal</local-path>
例如我有mysite 项目。这意味着 localhost:8080/mysite/= E:/internal 我可以通过 localhost:8080/mysite/从 E:/internal 获取文件
localhost:8080/mysite/file.jsp
我整个项目使用:
src="<%=request.getContextPath()%>/file.jsp"
在this article有一个如何将本地文件夹映射到 tomcat 的示例。
This
6. Now inside the above xml file put the following line:
<context docbase="d:/images"></context>
对我不起作用。我改成了
(1) <Context docBase="E:/internal"></Context>
它有效。但我有一个问题。例如我有 localhost:8080/mysite/about 页面。
当我使用(1)映射时
src="<%=request.getContextPath()%>/file.jsp" doesnt work because it returns mysite/file.jsp
当我尝试通过创建 mysite.xml 映射 mysite 时,项目没有启动,因为 mysite 是一个站点 url。
我该如何解决这个问题?