season22 发表于 2017-1-20 10:08:45

tomcat默认页诀窍

很多人肯定用tomcat的时候会遇到类似的问题。。。
配置了
<welcome-file-list>
<welcome-file>index.do</welcome-file>
</welcome-file-list>

但没有用,还是会404错误....挺烦人的,只能弄一个index.html重定向到index.do
但无疑是网站首页访问效率降低了,等于request了2个请求。。
无意看了一下tomcat注释
When a request URI refers to a directory, the default servlet looks for a "welcome file" within that directory and, if present,to the corresponding resource URI for display
也就是说,必须web-app目录下有index.do这个文件。。。。。。于是就加个.do后缀的空文件咯,居然成功了。。。
页: [1]
查看完整版本: tomcat默认页诀窍