I am trying to make a ajax call to other domain locally from my computer by writing some proxy code in jsp. And this is my jQuery AJAX code that is calling proxy.jsp page. And I have also modified the request header for the cookie part.
And my JSP file is:-
And when I get the response back from the server. I get this error. Any idea why I am getting this error back..
HTTP response code 401 means you didn't authenticate the request properly. (As you could easily have found out with at most 30 seconds of web searching.) So presumably that web site requires authentication.
But why is that code even in a JSP? It's bad enough that you have a whole lump of Java code in a scriptlet, but presumably inner classes in that code lead to even more confusion. It's not worth figuring out why, just put the code in a servlet where it belongs.