日期:2014-05-16 浏览次数:20453 次
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.5.6</version>
</dependency>
@RequestMapping(value="/content-type/{prodId}")
@ResponseBody
public Map<String,List<ContentType>> listContentTypeByProdJSONFormat(HttpServletRequest request,@PathVariable("prodId") int prodId)
{
List<ContentType> contentTypeList = contentTypeService.listContentTypeByProduct(prodId);
Map<String,List<ContentType>> contentTypes = new HashMap<String,List<ContentType>>();
contentTypes.put("contentTypes", contentTypeList);
return contentTypes;
}
success:function(data)
{
var typeList = data.contentTypes;
var length = typeList.length;
....
....
....
});