$.ajax({
type: "get",
url: "serverHistoryView.jsp",
data: {
"serverName": serverName,
"startDate": startDate,
"endDate": endDate
},
contentType: "application/html; charset=utf-8",
success: function(data) {
$("#response").html("");
$("#response").html(data);
}
});
I can get the data on JSP
String serverName=request.getParameter("serverName");

但是当我试图通过post request做同样的事情时。我无法在serverHistoryView.jsp上获取ajax数据。我该怎么办?
答案 0 :(得分:1)
尝试使用" data.d"而不是"数据"
$.ajax({
type: "get",
url: "serverHistoryView.jsp",
data: {
"serverName": serverName,
"startDate": startDate,
"endDate": endDate
},
contentType: "application/html; charset=utf-8",
success: function(data) {
$("#response").html("");
$("#response").html(data.d);
}
});