为什么新创建的.jsp运行显示的是index.jsp的结果啊?

img

img


为什么新创建的.jsp运行显示的是index.jsp的结果啊?

  tomcat自带的web.xml配置了welcome-file-list节点,该节点的子节点即为默认访问页面(welcome-file),welcome-file配置的顺序会影响到实际的默认访问,我们可以在自己的web.xml文件中配置welcome-file-list节点以覆盖tomcat自带的,tomcat自带的web.xml中配置的welcome-file-list节点如下:

<welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

你又没改tomacat的默认打开页

index.jsp是默认显示的,如果需要加载别的网页可以在idea中手动修改!