1. 程式人生 > >多麽痛的領悟----(碼農的低級錯誤)

多麽痛的領悟----(碼農的低級錯誤)

cached springmvc quest -s tex value lin 註解 掃描

(2017-7-23)

問題描述:

  頁面url請求發出後,顯示404; 控制臺debug:

[DEBUG] Last-Modified value for [/page/index] is: -1

  [org.springframework.web.servlet.DispatcherServlet]-

[DEBUG] Null ModelAndView returned to DispatcherServlet with name ‘springmvc‘: assuming HandlerAdapter completed request handling

  [org.springframework.web.servlet.DispatcherServlet]-

[DEBUG] Successfully completed request

  [org.springframework.beans.factory.support.DefaultListableBeanFactory]-

[DEBUG] Returning cached instance of singleton bean ‘sqlSessionFactory‘

結果:

<!-- 配置掃描器,[email protected] -->

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

但是: 項目中的base-package="controller"!!!

  base-package名稱不一致,導致無法掃描到controller, 才出現以上問題.

多麽痛的領悟----(碼農的低級錯誤)