Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-17119

Handling multiple @XXXMapping annotations on same handler method

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.1 RC1
    • Fix Version/s: 5.x Backlog
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      When using the @GetMapping, @PostMapping, ... shorthand annotations, except for the first one, all these annotation are ignored.

      Of course it means that only the first @RequestMapping annotation is being used.

      After short looking around, I'd guess instead of using the

      RequestMapping requestMapping = AnnotatedElementUtils.findMergedAnnotation(element, RequestMapping.class);
      

      in org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping:257, maybe using

      Set<RequestMapping> requestMapping = AnnotatedElementUtils.findAllMergedAnnotations(element, RequestMapping.class);
      

      plus required refactors with it could improve the situation.

      Thanks in advance,

      László Stahorszki

        Attachments

          Activity

            People

            • Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              rolaca11 László Stahorszki
              Last updater:
              Spring Issuemaster
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                47 weeks, 5 days ago