1. Map paramMap = new HashMap();
paramMap.put("brandList", list);
PrintWriter out = response.getWriter();
out.print(new Gson().toJson(paramMap));
out.flush();
out.close();
2.$.ajax({
url: "BrandServlet",
type: 'post',
dataType: 'json',
data: {},
success: function (data) {
$.each(data.brandList, function (i, n) {
if ($('#brandinfo').val() != n.id) {
var str = '' + n.brandName + '';
$('#brandinfo').append(str);
}
})
}
})
3.