我可以在子文件夹中设置一个欢迎文件的Tomcat吗? [英] Can I set Tomcat with a welcome-file in a subfolder?
本文介绍了我可以在子文件夹中设置一个欢迎文件的Tomcat吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人在办公室给我这个奇怪但有趣的问题。
Someone at the office threw me this weird-yet-interesting question.
如果我在web.xml(应用程序文件或容器文件)中有这样的东西
If I have something like this in a web.xml (either app' file or container's file)
<welcome-file-list>
<welcome-file>something.html</welcome-file>
</welcome-file-list>
这个东西在子文件夹中有一个可以使用的页面,所以我改变它...
and the thing has another page in a subfolder that can be used so I change it...
<welcome-file-list>
<welcome-file>subfolder/something.html</welcome-file>
</welcome-file-list>
如果第二个选项工作?谢谢!
¿Should the second option work? Thanks!
推荐答案
回答自己只是为了记录。
Answering to myself just to let it in the record.
是,可以完成。地址栏显示没有在welcome-file指令中指定的子文件夹的上下文URL。但它工作正常。
Yes, it can be done. The address bar shows the context URL without the subfolder specified in the welcome-file directive. But it works fine.
这篇关于我可以在子文件夹中设置一个欢迎文件的Tomcat吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文