spring jquery ajax

java code

@RequestMapping("/getAllLeagues")

@ResponseBody

public List<League> getAllLeagues(String feedId, String sportId) {

return //code here 

}

java script
$.ajax({

url : 'getAllLeagues',

data : {

feedId : feedId,

sportId : sportId

},

dataType : 'json',

type : 'POST',

success : function(leagues) {

//code here

},

error : function(league) {

}

});

相关推荐