I have the following Spring Controller
@Controller
@RequestMapping("/accreq")
with the following mapping
@RequestMapping(value = "/defRoles", method=RequestMethod.GET)
public @ResponseBody String loadDefaultRoles(
@RequestParam(value="idGroup", required=false) String groupID
throws ServletException{
I'm trying to call this method with the following jquery ajax
$.ajax({
type: 'GET',
url: '/accreq/defRoles',
data: {idGroup: $('#infoGroup').val() },
success: function() {
alert("success");
}
});
Please help me figure out why the Spring method is not being called even though the ajax method is being called when I click a button. I have stepped through the script with firebug and it definitely hits the ajax function.
First, try to see what happens if you hit the URL manually in the browser
If that is successful, turn on request tracking in firebug and see if firefox actually hits the URL (and what the response says)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With