在myeclipse10.0中正確配置好ssh後可能無法在運行服務器的時候訪問主頁的時候可能會遇到404錯誤.
原因在於(可能是因爲struct2.0攔截了index.jsp,因爲我嘗試過只配置struct2.0還是報404)
沒有配置好監聽器,配置好後就不會報404了
在web.xml文件中添加
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:bean.xml</param-value>
</context-param>
其實還是很好奇爲什麼添加監聽器後就不會出現這個問題,但是單獨配置struct2.0的時候就會出現.我覺得就算加入監聽器也跟這個錯誤無關,所以只能猜測是因爲struct2.0攔截了index.jsp,但是有個問題就是爲什麼監聽器就能是這個攔截無效呢?知道答案麻煩告訴一下,謝謝