今天在部署項目的時候,如果我沒有在自己的項目配置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目錄下的爲服務器全局作用域,一般用來配置全局設置、數據源等,而項目目錄下的爲局部作用域。