我的 AJAX 调用:
var url = "UsersGroupReader.html?selectedCompanyName=" + selectedCompanyName + "&test="+Math.random();
req.onreadystatechange = processAccessGroupRequest;
req.open("GET", url, true);
req.send(null);
function processAccessGroupRequest() {
if (req.readyState == 4) {
alert("req.status : " + req.status)
if (req.status == 200) {
var message = req.responseXML
alert("message " + message);
if (message == "No Database Connection") {
alert("Please check the database connection");
} else if (message == "DataDeleted") {
//alert("Data has been deleted from Database. Please LOGOUT and try again");
alert("Access Denied");
} else {
//setAccessGroups(message);
}
}
}
}
这是我的控制器
@RequestMapping(value = "Jsp/UsersGroupReader.html", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody Vector<String> readUsersGroup(HttpServletRequest request,
HttpSession httpSession) {
.....
.....
return Vector;
req.responseXML
是_null
返回的vector
对象是要读取的javascript
但是不知道怎么办?谁能帮帮我吗?