zoukankan      html  css  js  c++  java
  • org.springframework.web.servlet.DispatcherServlet noHandlerFound

    错误提示:

    org.springframework.web.servlet.DispatcherServlet noHandlerFound
    警告: No mapping found for HTTP request with URI [/spring/test] in DispatcherServlet with name 'spring'

    错误代码:@RequestMapping(name="/test")

    正确代码:@RequestMapping(value="/test")

    源码的注释:

    /**
         * Assign a name to this mapping.
         * <p><b>Supported at the type level as well as at the method level!</b>
         * When used on both levels, a combined name is derived by concatenation
         * with "#" as separator.
         * @see org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder
         * @see org.springframework.web.servlet.handler.HandlerMethodMappingNamingStrategy
         */
        String name() default "";

    /**
         * The primary mapping expressed by this annotation.
         * <p>In a Servlet environment this is an alias for {@link #path}.
         * For example {@code @RequestMapping("/foo")} is equivalent to
         * {@code @RequestMapping(path="/foo")}.
         * <p>In a Portlet environment this is the mapped portlet modes
         * (i.e. "EDIT", "VIEW", "HELP" or any custom modes).
         * <p><b>Supported at the type level as well as at the method level!</b>
         * When used at the type level, all method-level mappings inherit
         * this primary mapping, narrowing it for a specific handler method.
         */
        @AliasFor("path")
        String[] value() default {};

      这个错误搞了好久,因为凭着记忆写的,却偏偏将value误写成name,后台没有明显的提示错误信息,只是警告,所以就一直以为是配置信息有问题,一遍一遍的检测配置信息,一遍一遍的创建新的项目,一遍一遍的启动项目,真的是一手失成千古恨。

  • 相关阅读:
    vue-动画
    vue笔记-路由,组件
    自定义键盘信息
    自定义指令
    vue-笔记2
    轻松搭建基于 Serverless 的文档图片在线转换服务
    轻松搭建基于 SpringBoot + Vue 的 Web 商城应用
    一小时快速搭建基于阿里云容器服务-Kubernetes的Web应用
    阿里云正式推出内容平台“云栖号”:全面助力企业和个人上云决策
    云原生安全-更安全的密文管理 Vault on ACK
  • 原文地址:https://www.cnblogs.com/July74/p/5216021.html
Copyright © 2011-2022 走看看