Reputation: 2814
I ain't able to open 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);
My controller is:
@RequestMapping(value = "UsersGroupReader", method = RequestMethod.GET)
public Vector<String> readUsersGroup(HttpServletRequest request,
HttpSession httpSession) {
The req.status
I am receiving is 404
through AJAX
.
The pattern in my web.xml is as follows:
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
I tried using UsersGroupReader.html
in both the AJAX
function and the controller but still unable to access the controller.
Can anyone help me spot the mistake?
Could be a duplicate of this, in vain even after following it.
Thanks in Advance
Upvotes: 1
Views: 1580
Reputation: 140051
It's likely that the request you are sending is either not being received by the intended server or that the DispatcherServlet is not being invoked for the request. To troubleshoot these type of issues you can usually find the actual cause by:
Upvotes: 2