Check below quote from Spring reference:
By default Spring MVC automatically performs "." suffix pattern matching so that a controller mapped to /person is also implicitly mapped to /person.. This allows indicating content types via file extensions, e.g. /person.pdf, /person.xml, etc. A common pitfall however is when the last path segment of the mapping is a URI variable, e.g. /person/{id}. While a request for /person/1.json would correctly result in path variable id=1 and extension ".json", when the id naturally contains a dot, e.g. /person/joe@email.com the result does not match expectations. Clearly here ".com" is not a file extension.
if you do not want to use extension content negotiation you can disable it by this line in below code configurer.setUseSuffixPatternMatch(false);
or I think the below solution is better to just use registered Suffix, it is up to your needs
@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
//configurer.setUseSuffixPatternMatch(false);//this will disable all suffices from negotiation
configurer.setUseRegisteredSuffixPatternMatch(true);
}
}