为什么新创建的.jsp运行显示的是index.jsp的结果啊?
4条回答 默认 最新
关注
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>
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 1无用