org.springframework.web.servlet.DispatcherServlet noHandlerFound

1 请求URL:

http://localhost:8080/mvc/rojas
 

2 control  RequestMapping  :
 @RequestMapping(value="xxx/rojas")
    public String hello(){
        System.out.println("    param flag value:  ");
        return "rojas";
    }
    
 3 因为上述两个路径不匹配所以导致  
   org.springframework.web.servlet.DispatcherServlet noHandlerFound
警告: No mapping found for HTTP request with URI [/mvc/rojas] in DispatcherServlet with name 'spring' 

4  解决办法  请求URL和  RequestMapping 中的修改一致即可。

 比如把 请求URL 换成 http://localhost:8080/mvc/xxx/rojas

或者  把RequestMapping 换成  @RequestMapping(value="/rojas")。

5  若是其他问题导致的,请跳过这个原因。

原文地址:https://www.cnblogs.com/rojas/p/6140104.html