今天在部署项目的时候,如果我没有在自己的项目配置web.xml的
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file></welcome-file-list>
所有的请求链接都会走tomcat下的web.xml中的
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
tomcat中的web.xml是通用的,如果不设置,那么就会默认是同tomcat的web.xml,如果你设置了,那么当然是项目下的web.xml中的设置优先权更高一点.
加载顺序是 1、tomcat conf目录下; 2、项目目录下的; tomcat config目录下的为服务器全局作用域,一般用来配置全局设置、数据源等,而项目目录下的为局部作用域。