I have an application using Spring 3.2.2. I run it on Tomcat.
In the app I have a controller that returns JSON.
If controller request mapping contain strings ".com
", ".org
", ".talk
", I get HTTP error 406
The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.
Example:
This works fine:
@RequestMapping(method = RequestMethod.GET, value = "/test.test")
public @ResponseBody Map<String, String> test() {
Map<String, String> stringMap = new HashMap<String, String>();
stringMap.put("test", "test");
return stringMap;
}
This causes http error 406:
@RequestMapping(method = RequestMethod.GET, value = "/test.talk")
public @ResponseBody Map<String, String> test() {
Map<String, String> stringMap = new HashMap<String, String>();
stringMap.put("test", "test");
return stringMap;
}
The issue is not reproduced with all domain names I tried. For example ".net
" works fine.