我是一個struts2的初學者,按照
max的方法建了一個struts2的工程,目錄結構如下圖:

在WebContent目錄下建一個名叫index.html的頁面,在tomcat中配置虛擬路徑
<Context path="/struts2" docBase="F:\Struts2.0\WebContent" debug="0" crossContext="true" reloadable="true"/>
然后重起tomcat,在瀏覽器中輸入
http://localhost:8080/struts2提示:HTTP Status 404 - /struts2/。
但是,當我在tomcat配置虛擬路徑時,這樣配置
<Context path="/struts2" docBase="F:\Struts2.0" debug="0" crossContext="true" reloadable="true"/>
重起tomcat,在瀏覽器中輸入
http://localhost:8080/struts2/WebContent,這時瀏覽器中就可以顯示出index.html頁面。
為什么會出現這種情況呢?
但是我在建其他工程,非struts2的工程的時候,就不會出現這種情況,難道是我的tomcat5.5不支持struts2嗎?也不可能啊。
posted on 2007-08-30 19:08
Elven 閱讀(635)
評論(2) 編輯 收藏