正确格式
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
不允许
<welcome-file-list>
<welcome-file>index.do</welcome-file>
</welcome-file-list>
上述配置情况下启动服务器,终是报404错误,但我在地址栏手工加入index.do时,页面正常显示。
原因:<welcome-file>index.jsp </welcome-file> 节点中只能包含HTML、HTM、TEXT文件,不能访问控制器
本文探讨了服务器配置文件中welcome-file列表的正确使用方法。强调了该列表仅能包含HTML等静态文件类型,并不能用于指向控制器如index.do的情况。通过一个具体示例,解释了为何在配置中使用非静态文件会导致404错误。

被折叠的 条评论
为什么被折叠?



