我想将 url 映射到位于服务器上的文件,非常类似于在 httpd.conf 中为 Apache 添加别名。我似乎无法找到一种方法来为 Tomcat 做同样的事情。
谁能帮我解决这个问题?
参考马克的回复,我尝试了以下方法:
<Context>
/alias/html/plugins = /opt/apache-tomcat-7.0.53/webapps/html/plugins,/alias/html/IdaaS = /opt/apache-tomcat-7.0.53/webapps/html/IdaaS
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
<!-- Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->
</Context>
参考http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
当我点击 url http://someurl:8080/html/plugins
时,它不起作用,但是有这样一个目录