I have written a preHandle method that will check the URL for a token and it works fine.
But will the same work for ajax calls?
public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response,final Object handler) throws Exception {
String requesttoken = request.getParameter("token");
if (requesttoken != null && validatetoken(requesttoken)) {
return true;
} else {
response.sendRedirect("/404.html");
return false;
}
}