在web.xml中加入以下代码,然后重启服务器就可以了.

<welcome-file-list>
    <welcome-file>这儿写你要显示的页面名称</welcome-file>
</welcome-file-list>

添加位置如下:

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
    <welcome-file-list>
        <welcome-file>login.jsp</welcome-file>
    </welcome-file-list>
</web-app>

这样运行项目时就默认显示login.jsp页面了

相关文章:

  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2021-11-30
  • 2021-08-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2021-11-06
  • 2021-11-27
  • 2021-06-23
  • 2022-12-23
  • 2021-08-17
相关资源
相似解决方案