In My controller i have a method below which is working well
@RequestMapping(value="/searchresults",method = RequestMethod.GET)
public SearchResponse searchResults(
@PathVariable("domain") String domain,
@RequestParam(value="rowCount" , defaultValue="0", required=false) Integer rowCount,
HttpServletRequest req){}
but the same thing is not working when adding headers,
@RequestMapping(value="/searchresults", method = RequestMethod.GET,headers = "application/json;charset=UTF-8")
public SearchResponse searchResults(
@PathVariable("domain") String domain,
@RequestParam(value="rowCount" , defaultValue="0", required=false) Integer rowCount,
HttpServletRequest req){}
Exception : Representation: null org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException: No matching handler method found for servle t request: path '/search/searchresults.json', method 'GET',
I tried as follows,
@RequestMapping(value="/searchresults", method = RequestMethod.GET,headers = {"content-type=application/json,charset=UTF-8"})
but it throws, java.lang.IllegalArgumentException: "charset=UTF-8" does not contain '/'
How to resolve it