Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
When using the
Of course it means that only the first
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,
Affects: 5.1 RC1
Hi, sorry for jumping in here but I think I have the same issue (running Spring 4.3.22.RELEASE).
You may want to bind Controller methods e.g. to multiple POST requests depending on the parameters provided. For instance, I have the following Controller specified (simplified):
When a POST is sent, the first PostMapping fires all the time, regardless of the parameter value (in the above case, "type" is ignored and "unsubscribe" fires for every POST request) specified. Unfortunately I can not change the requests coming which are provided by a third party. I think this might be related to the above-mentioned issue.
@micvm This looks like another issue altogether. The current issue is about mixing several Mapping annotations on the same controller method, which you're not doing.
Moreover, I've tried to reproduce this with Spring Boot 1.5.19.RELEASE and couldn't. If you can reproduce that with a repro project, could you create another issue and point to a simple project reproducing the problem?