問題:
<welcome-file-list>中的<welcome-file>標簽部分除了放具體的jsp或html頁面(例如下)
<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>
我用spring MVC,按照以下配置
<welcome-file-list>
<welcome-file>index.do</welcome-file>
</welcome-file-list>
啟動服務器,終是報404錯誤,但我在地址欄手工加入index.do時,頁面正常顯示,這是為什么,是不是服務器不支持這樣的寫法(index.do)????如果支持應該如何寫????
回答:
支持...不過tomcat 會去檢查有沒有index.do這個文件.
意思大概就是這樣,首先讀取 welcome list,然后取得第一個index,然后到web中的路徑中查找有沒有這個文件,沒有繼續(xù)第二個.
然后繼續(xù)下去沒有,就提示沒有主頁.
解決辦法:
在你的WebRoot 下添加一個空白的文件命名為 index.do