Updated Answer
PathMatchConfigurer tries to map each /controller/path.* to each suffix, trying to find the type of content using the ContentNegotiationManager . You can change this behavior either by disabling it, or by making it an attempt only when. * - registered suffix. See here: http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-config-path-matching
You must either call pathMatchConfigurer.setUseRegisteredSuffixPatternMatch(true) or pathMatchConfigurer. setUseSuffixPatternMatch(false) pathMatchConfigurer. setUseSuffixPatternMatch(false)
Old answer :)
I think Spring MVC mistakenly believes that .pl is an extension and is looking for an HTTPMessageConverter for this type of media. Creating a converter here would not make sense in this scenario, but perhaps designating this as another type of media would work? I would only consider this as a workaround.
I also think that your @RequestMapping value could be simple: value = "/user/{username}" - you are using RegEx. + for your username variable, which essentially means that you are matching the entire template anyway.
source share