1. 程式人生 > >idea運行時默認顯示的index.jsp修改方法

idea運行時默認顯示的index.jsp修改方法

www. log -a location 添加位置 位置 welcome 方法 web.xml

在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頁面了

idea運行時默認顯示的index.jsp修改方法