lundi 23 février 2015

Spring MVC: jackson-mapper-asl not work with Spring 4

I am trying to convert List of objects into json with the help of jackson-mapper-asl libraries, but in response i got http 406 error. jackson-mapper-asl libraries are on my class path. Following is my Spring MVC controller code:



@RequestMapping(value="/find-sub-categories/{parentId}", method=RequestMethod.GET)
@ResponseBody public List<ProductCategory> findSubCategories(@PathVariable(value="parentId") ProductCategory productCategory) {
logger.info("In ADMIN findSubCategories Contoller AJAX GET");

List<ProductCategory> categories = productCategoryService.findAllChildProductCategoriesByParent(productCategory);
return categories;
}


My Ajax request code:



$.ajax({
url: url+"/"+parentId,
type: 'GET',
success: function(result) {
var arr = $.parseJSON(result);
-----------------------

Aucun commentaire:

Enregistrer un commentaire