Can I set Tomcat with a welcome-file in a subfolder?

雨燕双飞 提交于 2019-12-08 03:16:51

问题


Someone at the office threw me this weird-yet-interesting question.

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!


回答1:


Answering to myself just to let it in the record.

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.



来源:https://stackoverflow.com/questions/4620063/can-i-set-tomcat-with-a-welcome-file-in-a-subfolder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!