后台传递给前台,Json获取的值为undefined

js代码

$(function() {
		var goodses=get();
		var goodsNum=0;
		var params="{\"goodsIds\":\"";
		for(var i=0; i

java代码

private String goodsIds;
private String result;
public String getGoodsesByIds(){
	String[] ids = goodsIds.split(",");
	goodses=goodsService.getGoodsesByIds(ids);
	//产生json时不考虑下列值,减小json大小
	JsonConfig c = new JsonConfig();
	c.setExcludes(new String[]{"category","goodsNo","categoryId",
			"price1","stock","description"});
		
	JSONArray a = JSONArray.fromObject(goodses,c);
	result = a.toString();
	return "getgoodsesbyids";
}


你可能感兴趣的:(J2EE)