本人小菜鸟,求大神解惑ajax提交jsp页面数据,怎么获得数据库返回出来的数据并显示出来
这是jsp页面提交方法
function sbmt() {
				var toDate = new Date();
				var h = toDate.getHours();
				var m = toDate.getMinutes();
				var s = toDate.getSeconds();
				toDate.toLocaleDateString();
				var content = $("#content").html();
				var userId = $("#userId").val();
				var currentUser="用户";
				var imei = $("#imei").val();
				if (content == "请在此输入您想咨询的问题:") {
					alert("请输入资讯信息");
				}else{
					$.ajax({
						type:"post",
						url:"/aqapp/user_serviceCenter.do",
						data:{"params.type":"msg","ce.imei":imei,"ce.userId":userId,"userMsg.notice":content},
						success:function(data){
							var userMessage="<span class=\"getHeights\">"+
								"<p>"+currentUser+"   "+h+":"+m+":"+s+"</p>"+
								"<p>  "+content+"</p>"+
								"</span>";
							$("#showContent").append(userMessage);
							$("#showContent").scrollTop($("#showContent").height()+$(".getHeights").innerHeight())
						}
					});
				}
			}
这是Action里查询出来的数据
response.setCharacterEncoding("UTF-8");
				//获得系统当前时间
				Date date = new Date();
				SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
				String imei = ce.getImei();
				String useridd = ce.getUserId();
				int userId = Integer.parseInt(useridd);
				String content = userMsg.getNotice();
				content =  java.net.URLDecoder.decode(content,"UTF-8");  
				String datetime = format.format(date);
				boolean bool = userSevice.addClientConsult_t(content, userId, imei, datetime);
				if(bool){
					//这里保存查询到的数据
					List<ClientConsult> list =(List<ClientConsult>) this.userSevice.findClientConsult(userId);
				}
              
------解决方案--------------------response.getWriter().print(list)……把list加入到相应里面,然后ajax就能获得了……你可以用浏览器的网络监控看看发出的request和返回的response