@Override public void commence( HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { super.commence(request, response, authException); }
@Override public void commence( HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { if ("XMLHttpRequest".equals(request.getHeader("X-Requested-With"))) { // response.sendError(403, "Forbidden"); response.getWriter().write("Sorry !! User js not Authorized"); } else { super.commence(request, response, authException); } }