确保根目录下创建一个名为WEB-INF的文件夹(注意:每个字母都要大写)
方法1:
在 tomcat主目录/conf下打开 web.xml文件,在最后边的
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
中进行设置!
方法2:
在建立的WEB-INF目录下建立web.xml文件,并写入以下代码进行设置:
<web-app>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
注意:方法1中的web.xml文件是tomcat默认的。方法2中的<welcome-file-list>元素添加上去后,会覆盖方法1中的web.xml中的<welcome-file-list>元素内容。
方法1:
在 tomcat主目录/conf下打开 web.xml文件,在最后边的
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
中进行设置!
方法2:
在建立的WEB-INF目录下建立web.xml文件,并写入以下代码进行设置:
<web-app>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
注意:方法1中的web.xml文件是tomcat默认的。方法2中的<welcome-file-list>元素添加上去后,会覆盖方法1中的web.xml中的<welcome-file-list>元素内容。