0
点赞
收藏
分享

微信扫一扫

IDEA 设置JSP启动页面/默认页面

杨沐涵 2023-05-07 阅读 78

一图解千惑

IDEA 设置JSP启动页面/默认页面_html

在项目中WEB-INF中的web.xml文件中配置项目的默认启动页面。web.xml

 是个XML格式的文件

<?xml version="1.0" encoding="UTF-8"?>
<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_4_0.xsd"
         version="4.0">
 
</web-app>

最开始是这样的的我们加入配置

<welcome-file-list>
        <welcome-file>default.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
    </welcome-file-list>

完整配置


<?xml version="1.0" encoding="UTF-8"?>
<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_4_0.xsd"
         version="4.0">
    <welcome-file-list>
        <welcome-file>default.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
    </welcome-file-list>
</web-app>

举报

相关推荐

0 条评论