Using annotaion @ResponseBody in your method is enough. this will solve your problem.
@RequestMapping(value = "/android/api/home", method = RequestMethod.GET, produces=MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody void Home(Locale locale, Model model,HttpServletRequest request,HttpServletResponse response) throws IOException {
}
add content type to ajax call
jQuery
.ajax({
url : controllerUrl,
data : oMyForm,
dataType : 'text',
processData : false,
contentType : false,
type : 'POST',
success : function(data) {
}
});
source
share