要设置Tomcat的默认静态资源访问,可以在Tomcat的配置文件中进行配置。
-
找到Tomcat的conf目录,其中包含了一些配置文件。
-
在conf目录中找到web.xml文件。
-
在web.xml文件中找到welcome-file-list元素,通常是以
<
welcome-file-list>
开头的标签。 -
在welcome-file-list元素中修改以下内容:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>