AJAX unable to call a springs controller
I am unable to give a call to my springs controller through AJAX.The
console also shows no error or warnings.Here is my AJAX code
$(document).ready(function(){
$.ajax({
type: "POST",
url: "/updateUserStatus.html",
data: "check ",
success: function() { alert("success"); }
});
});
And my relevant controller code is
@RequestMapping(value="/updateUserStatus",method=RequestMethod.POST)
public ModelAndView updateUserStatus(@ModelAttribute("username")
String username,
BindingResult result) {
System.out.println("inside update user status");
userService.updateStatus(username);
return new ModelAndView("");
}
Is there anything wrong I am doing?
No comments:
Post a Comment