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的配置,否则使用自己的配置             web.xml中欢迎页面的配置

 

相关文章:

  • 2021-07-16
  • 2022-01-11
  • 2022-12-23
  • 2021-12-24
  • 2022-03-02
  • 2021-11-03
  • 2022-02-07
  • 2022-12-23
猜你喜欢
  • 2021-11-04
  • 2021-09-22
  • 2021-10-09
  • 2021-11-17
  • 2022-12-23
  • 2021-12-12
  • 2021-10-21
相关资源
相似解决方案