部署Tomcat后如何修改服务器的默认访问资源

要设置Tomcat的默认静态资源访问,可以在Tomcat的配置文件中进行配置。

  1. 找到Tomcat的conf目录,其中包含了一些配置文件。

  2. 在conf目录中找到web.xml文件。

  3. 在web.xml文件中找到welcome-file-list元素,通常是以 ​<welcome-file-list>​开头的标签。

  4. 在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>

猜你喜欢

转载自blog.csdn.net/weixin_60246228/article/details/131752558