高峰之巅 发表于 2017-2-2 06:53:11

Tomcat部署描述符与目录的默认页

tomcat中的conf/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>

如果客户端访问的URL指向的是一个目录,而不是一个文件名,那么tomcat会按照<welcome-file-list>指定的默认网页的顺序,依次在该目录中查找,将最先找到的文件发送给浏览器,并停止查找后面的网页文件.
WEB-INF中的web.xml文件

<web-app>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

将覆盖上面的设置而不是对它增加
页: [1]
查看完整版本: Tomcat部署描述符与目录的默认页