-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Will Glass-Husain opened SPR-9333 and commented
There's a bug introduced in 3.0.6 (also exists in 3.0.7) with the @PathVariable
. It's very similar to #10038 though it was actually reintroduced in #13187.
If a item is included on the path that has a period, it's impossible for the full string to be picked up by the path variable. For example, with this URL and request mapping, userEmail is set to "jsmith@mail".
http://mydomain.com/myapp/api/user/[email protected]
and this method
@RequestMapping(value = {"/{userEmail}"}, method = RequestMethod.GET)
public ModelAndView doGet(@PathVariable final String userEmail)
{
}
My code also had a class-wide request mapping, though I'm not sure if it's relevant.
The usual advice is to include a DefaultAnnotationHandlerMapping in the context and set the property useDefaultSuffixPattern to false. However, in 3.0.6, code was introduced into AnnotationMethodHandlerAdapter.getMatchingPattern() which adds .* to the pattern (eliminating the so-called file extension) but which is not suppressed by useDefaultSuffixPattern.
Affects: 3.0.6, 3.0.7
Sub-tasks:
- Backport "@PathVariable drops extension" [SPR-9419] #14055 Backport "
@PathVariable
drops extension"
Referenced from: commits cf5d551, 8143d66
0 votes, 5 watchers