How to define RequestMapping prioritization
Posted
by
James Skidmore
on Stack Overflow
See other posts from Stack Overflow
or by James Skidmore
Published on 2012-09-28T21:01:44Z
Indexed on
2012/09/28
21:37 UTC
Read the original article
Hit count: 215
I have a situation where I need the following RequestMapping
:
@RequestMapping(value={"/{section}"})
...method implementation here...
@RequestMapping(value={"/support"})
...method implementation here...
There is an obvious conflict. My hope was that Spring would resolve this automatically and map /support
to the second method, and everything else to the first, but it instead maps /support
to the first method.
How can I tell Spring to allow an explicit RequestMapping
to override a RequestMapping
with a PathVariable
in the same place?
(Edit - this is simplified, I know that having those two RequestMapping
alone wouldn't make much sense)
© Stack Overflow or respective owner