1. 程式人生 > >No mapping found for HTTP request with URI [xxxx] in DispatcherServlet with name ‘xxx’

No mapping found for HTTP request with URI [xxxx] in DispatcherServlet with name ‘xxx’

搭建SSM環境時測試springMVC時出現個很有趣的問題:

 測試webapp下的index.jsp沒問題,但是測試hello就出現問題。

當訪問hello時出現如下問題:

解決方案:

         之前掃描包時這樣:

           <context:component-scan base-package="com.itshenjin.controller.*" />

         修改後:

         <context:component-scan base-package="com.itshenjin.controller" />

         或者:<context:component-scan base-package="com.itshenjin.controller.**" />

   如果能解決你的問題,那最好不過了。如果解決不了,也請不要噴我。

    畢竟:我頭疼,可能是感冒引起的。你頭疼,可能是發燒引起的。

    我在這裡只是記錄我的問題。謝謝來過。