Java 在web应用程序中定义Tomcat上下文的别名

Java 在web应用程序中定义Tomcat上下文的别名,java,tomcat,alias,context.xml,Java,Tomcat,Alias,Context.xml,我已使用两台主机设置了Tomcat 8.0: 其中,/upload在webapp中用作保存上载文件的虚拟路径。启动应用程序时,将显示此警告: org.apache.catalina.startup.SetContextPropertiesRule.begin [SetContextPropertiesRule]{Context} Setting property 'aliases' to '/upload=/home/myuser/somepath' did not find a m

我已使用两台主机设置了Tomcat 8.0:

其中,
/upload
在webapp中用作保存上载文件的虚拟路径。启动应用程序时,将显示此警告:

org.apache.catalina.startup.SetContextPropertiesRule.begin [SetContextPropertiesRule]{Context}     
Setting property 'aliases' to '/upload=/home/myuser/somepath' did not find a matching property

当我在应用程序中的
/upload
中保存文件时,它只会保存在部署的应用程序中的
upload
目录中(而不是保存在
/home/myuser/somepath
中)。当没有两个
Host
s时,此设置会起作用。是一个bug,或者此功能在此配置中不起作用,或者是一些配置错误?

您将从错误消息和Tomcat 8文档中注意到,
别名属性不再存在


请参阅以解决它(以及可能出现的其他问题)。

非常感谢!这个链接也帮助了我:
<Context path="/" aliases="/upload=/home/myuser/somepath"></Context>
org.apache.catalina.startup.SetContextPropertiesRule.begin [SetContextPropertiesRule]{Context}     
Setting property 'aliases' to '/upload=/home/myuser/somepath' did not find a matching property