更改war文件中的默认页面

use*_*101 1 java netbeans war

我为我的web应用程序创建了一个war文件.我在Tomcat上部署了它,它运行正常.我的问题是,如果我有3个jsp文件,如index.jsp,one.jsp,two.jsp,如果我想在运行war文件时先运行one.jsp(而不是index.jsp),该怎么办?目前index.jsp主要运行.我正在使用netbeans,netbeans中有没有选项???

Cha*_*dNC 5

我想你可以通过设置welcome-file-list在WEB-INF文件夹的web.xml中设置它

通常看起来像

<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>
Run Code Online (Sandbox Code Playgroud)

改为

 <welcome-file-list>
    <welcome-file>one.jsp</welcome-file>
</welcome-file-list>
Run Code Online (Sandbox Code Playgroud)