I am working with a spring MVC controller which will return a boolean value as response to the ajax request. But when spring mvc is trying to return a boolean value it is giving me the server responded with a status of 406 (Not Acceptable) error Please Help. Thanks in advance
This is my controller
@Controller
public class MainController {
@RequestMapping(value="/check.html",method=RequestMethod.POST)
public @ResponseBody Boolean checkValue(){
return true;
}
}
This is my Ajax method
<script type="text/javascript">
function doAjax() {
$.ajax({
type : "post",
url : 'check.html',
success : function(response) {
if(response===true)
{
window.alert("true");
}
else
{
window.alert("false");
}
},
error : function(e){
window.alert("error");
}
});
}
</script>