I have defined the below controller
@Controller
public class HelloController {
@RequestMapping(value = "/config/{name:.*}", produces = MediaType.TEXT_PLAIN_VALUE, method = RequestMethod.GET)
@ResponseBody
ResponseEntity<String> getValue(@PathVariable String name) {
String value = "Hello World";
return new ResponseEntity<String>(HttpStatus.OK);
}
}
when i ping the url from the browser ex: http://localhost:8080/example/config/test.abc
The request works fine.
But when i ping with url http://localhost:8080/example/config/test.uri
it just blows the page with the error:
The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.
I tried MessageConverters and configureContentNegotiation nothing seems to be working. I am wondering if spring treats test.uri as an invalid patterns or reserved keywords.
Environments i tried. Spring 4/Tomcat 7 & 8 Spring 5/ Tomcat 9