我做hellocontroller的时候是成功了,但是做第一个页面的时候就一直404了?下面贴出日志

来源:4-3 Controller-现代方式

慕UI8279037

2016-07-08 16:28

1600 [qtp1743310468-14] DEBUG org.springframework.web.servlet.DispatcherServlet  - DispatcherServlet with name 'mvc-dispatcher' processing GET request for [/courses/view]

1600 [qtp1743310468-14] DEBUG org.springframework.web.servlet.DispatcherServlet  - DispatcherServlet with name 'mvc-dispatcher' processing GET request for [/courses/view]

1602 [qtp1743310468-14] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping  - Looking up handler method for path /courses/view

1602 [qtp1743310468-14] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping  - Looking up handler method for path /courses/view

1602 [qtp1743310468-14] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping  - Did not find handler method for [/courses/view]

1602 [qtp1743310468-14] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping  - Did not find handler method for [/courses/view]

1603 [qtp1743310468-14] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping  - Matching patterns for request [/courses/view] are [/**]

1603 [qtp1743310468-14] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping  - Matching patterns for request [/courses/view] are [/**]

1603 [qtp1743310468-14] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping  - URI Template variables for request [/courses/view] are {}

1603 [qtp1743310468-14] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping  - URI Template variables for request [/courses/view] are {}

1604 [qtp1743310468-14] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping  - Mapping [/courses/view] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler@603d6637] and 1 interceptor

1604 [qtp1743310468-14] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping  - Mapping [/courses/view] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler@603d6637] and 1 interceptor

1604 [qtp1743310468-14] DEBUG org.springframework.web.servlet.DispatcherServlet  - Last-Modified value for [/courses/view] is: -1

1604 [qtp1743310468-14] DEBUG org.springframework.web.servlet.DispatcherServlet  - Last-Modified value for [/courses/view] is: -1

1609 [qtp1743310468-14] DEBUG org.springframework.web.servlet.DispatcherServlet  - Null ModelAndView returned to DispatcherServlet with name 'mvc-dispatcher': assuming HandlerAdapter completed request handling

1609 [qtp1743310468-14] DEBUG org.springframework.web.servlet.DispatcherServlet  - Null ModelAndView returned to DispatcherServlet with name 'mvc-dispatcher': assuming HandlerAdapter completed request handling

1609 [qtp1743310468-14] DEBUG org.springframework.web.servlet.DispatcherServlet  - Successfully completed request

1609 [qtp1743310468-14] DEBUG org.springframework.web.servlet.DispatcherServlet  - Successfully completed request


写回答 关注

3回答

  • java_forever
    2017-01-18 17:46:57

    @AutoWired有没有配好?


    qq_昨夜星...

    Autowired这里总是报错,提示 expected at least 1 bean which qualifies as autowire candidate. controller没有调用ompl,model里面有@Service注解

    2017-06-21 11:02:38

    共 1 条回复 >

  • decodelife
    2016-08-07 12:28:17

    需要贴你的源码看下啊

  • decodelife
    2016-07-09 20:22:14

    Null ModelAndView returned to DispatcherServlet with name 'mvc-dispatcher': assuming HandlerAdapter completed request handling

    这个错误提示,好像是说你的返回没有指定到已知的页面,你可以查看下springMVC的配置是否正确,然后,controller的方法返回的页面名称是否存在

    时而abc 回复慕UI827...

    楼主我和你一样,怎么解决的啊

    2017-07-20 22:09:57

    共 3 条回复 >

Spring MVC起步

Java中Spring MVC框架入门教程,快来看最易用的MVC框架

195953 学习 · 606 问题

查看课程

相似问题