I'm having trouble accessing the controller's method
var url = "UsersGroupReader";
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
req.onreadystatechange = processAccessGroupRequest;
req.open("GET", url, true);
req.send(null);
The controller code is:
@RequestMapping(value = "UsersGroupReader", method = RequestMethod.GET)
public Vector<String> readUsersGroup(HttpServletRequest request,
HttpSession httpSession) {
The response I am getting is a 404
error when using AJAX.
The mapping in my web.xml looks like this:
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
I have tried using UsersGroupReader.html
in both the AJAX call and the controller, but still can't access it.
Can someone help me find the mistake?
This issue might be similar to this one, but unfortunately following those steps didn't fix it.
Thank you in advance!