關(guān)于web.xml中的(注:轉(zhuǎn)載于http://yjshengshe.javaeye.com/blog/641934)
問題:
<welcome-file-list>中的<welcome-file>標(biāo)簽部分除了放具體的jsp或html頁面(例如下)
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
外能不能放一個(gè)請求在里面?(例如下)
<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>
啟動服務(wù)器,終是報(bào)404錯(cuò)誤,但我在地址欄手工加入index.do時(shí),頁面正常顯示,這是為什么,是不是服務(wù)器不支持這樣的寫法(index.do)????如果支持應(yīng)該如何寫????
回答:
支持...不過tomcat 會去檢查有沒有index.do這個(gè)文件.
意思大概就是這樣,首先讀取 welcome list,然后取得第一個(gè)index,然后到web中的路徑中查找有沒有這個(gè)文件,沒有繼續(xù)第二個(gè).
然后繼續(xù)下去沒有,就提示沒有主頁.
解決辦法:
在你的WebRoot 下添加一個(gè)空白的文件命名為 index.do
<welcome-file-list>中的<welcome-file>標(biāo)簽部分除了放具體的jsp或html頁面(例如下)
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
外能不能放一個(gè)請求在里面?(例如下)
<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>
啟動服務(wù)器,終是報(bào)404錯(cuò)誤,但我在地址欄手工加入index.do時(shí),頁面正常顯示,這是為什么,是不是服務(wù)器不支持這樣的寫法(index.do)????如果支持應(yīng)該如何寫????
回答:
支持...不過tomcat 會去檢查有沒有index.do這個(gè)文件.
意思大概就是這樣,首先讀取 welcome list,然后取得第一個(gè)index,然后到web中的路徑中查找有沒有這個(gè)文件,沒有繼續(xù)第二個(gè).
然后繼續(xù)下去沒有,就提示沒有主頁.
解決辦法:
在你的WebRoot 下添加一個(gè)空白的文件命名為 index.do
posted on 2010-12-26 10:21 小一敗涂地 閱讀(430) 評論(0) 編輯 收藏 所屬分類: tomcat、apache、jboss等服務(wù)器相關(guān)