I have Spring 3.2 web app and i have controller with following request mappings:
@RequestMapping(value = \"/test/{param1}\", method = RequestMethod.GET)
publ
Can i be sure that if someone ask for url /test/login
the method2 will be invoked?
Yes.
The mappings are resolved by specificity, the relevant piece of doc is available here
A pattern with a lower count of URI variables and wild cards is considered more specific. For example
/hotels/{hotel}/*
has 1 URI variable and 1 wild card and is considered more specific than/hotels/{hotel}/**
which as 1 URI variable and 2 wild cards.If two patterns have the same count, the one that is longer is considered more specific. For example
/foo/bar*
is longer and considered more specific than/foo/*
.When two patterns have the same count and length, the pattern with fewer wild cards is considered more specific. For example
/hotels/{hotel}
is more specific than/hotels/*
.
If the two mappings match a request, a more specific will apply. Out of the two mappings, /test/login
is more specific.