首页 > 解决方案 > 如何在 tomcat 中设置指向 webapp 中另一个文件的 url 路径?

问题描述

我在 tomcat 的 Webapps/MyApp/Web/index.html 位置有一个文件。

如果我使用以下 URL,我可以访问它: :/MyApp/Web/index.html

我想再使用一个 URL 来访问这个位置::/MyApp/Strom/Web/index.html

我的 webapp 中不存在 Strom 目录,我不希望它存在,我只想将 Strom 的 URL 重定向到 Web。

如何通过设置上下文路径在 tomcat 中实现这一点?

我尝试在 host 标记下的 server.xml 中设置上下文路径。

但它没有用。

标签: tomcatcontextpathcontext.xmlserver.xmldocbase

解决方案


推荐阅读