Here is the AJAX call I am working with:
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);
}
}
}
}
This snippet represents my controller logic
@RequestMapping(value = "Jsp/UsersGroupReader.html", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody Vector<String> readUsersGroup(HttpServletRequest request,
HttpSession httpSession) {
.....
.....
return Vector;
I am currently facing an issue where req.responseXML
is returning null
I need assistance in reading the returned vector
object in my javascript
code. Can someone provide guidance?