web.xml中欢迎页面的配置

1.配置欢迎页面的方式

<welcome-file-list>
        <welcome-file>index.html</welcome-file>
</welcome-file-list>

2.欢迎页面可以设置多个

<welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>html/welcome.html</welcome-file>
</welcome-file-list>

3.欢迎页面的注意事项

  1)欢迎页面不以“/”开头

  2)必须保证在webapp根目录下有此资源

  3)优先级自上而下,越靠上优先级越高

  4)欢迎页面不一定是html,可以是任意一种资源:servlet、jsp

4.全局欢迎页面在web服务器(tomcat)中配置了

  下图为tomcat服务器下conf文件夹中web.xml文件的欢迎页面的配置,此为全局配置,若自己项目中没有配置欢迎页面则默认使用tomcat的配置,否则使用自己的配置             

原文地址:https://www.cnblogs.com/luna-hehe/p/14522263.html