Null ModelAndView returned to DispatcherServlet with name 'applicationContext': assuming HandlerAdapter completed request handling
问题现象:
后台输出:
2016-03-21 16:00:40 |-DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'applicationContext' processing GET request for [/bx/api/v2/ins/admin/retry/orderId]
2016-03-21 16:00:40 |-DEBUG o.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Looking up handler method for path /bx/api/v2/ins/admin/retry/orderId
2016-03-21 16:00:40 |-DEBUG o.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Returning handler method [public com.fengjr.insurance.common.base.BaseResult com.fengjr.insurance.pc.controller.AdministratorController.retry(java.lang.String)]
2016-03-21 16:00:40 |-DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'administratorController'
2016-03-21 16:00:40 |-DEBUG org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/bx/api/v2/ins/admin/retry/orderId] is: -1
2016-03-21 16:00:40 |-DEBUG o.s.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver - Resolving exception from handler [public com.fengjr.insurance.common.base.BaseResult com.fengjr.insurance.pc.controller.AdministratorController.retry(java.lang.String)]: org.springframework.web.bind.ServletRequestBindingException: Missing URI template variable 'orderId' for method parameter of type String
2016-03-21 16:00:40 |-DEBUG org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver - Resolving exception from handler [public com.fengjr.insurance.common.base.BaseResult com.fengjr.insurance.pc.controller.AdministratorController.retry(java.lang.String)]: org.springframework.web.bind.ServletRequestBindingException: Missing URI template variable 'orderId' for method parameter of type String
2016-03-21 16:00:40 |-DEBUG org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Resolving exception from handler [public com.fengjr.insurance.common.base.BaseResult com.fengjr.insurance.pc.controller.AdministratorController.retry(java.lang.String)]: org.springframework.web.bind.ServletRequestBindingException: Missing URI template variable 'orderId' for method parameter of type String
2016-03-21 16:00:40 |-DEBUG org.springframework.web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'applicationContext': assuming HandlerAdapter completed request handling
2016-03-21 16:00:40 |-DEBUG org.springframework.web.servlet.DispatcherServlet - Successfully completed request
原因分析:
请求的URI找不到对应映射,@RequestMapping配置的URI中地址错误,变量要用大括号{}括起来
解决方法:
变量部分更改为{orderId}
ok,可以正常访问了