I have web server hosted in Apache Tomcat 7 with Basic authentication. I have Tomcat user \'tomcat\' with role \'tomcat\' and password \'tomcat\'. Following are my web.xml f
Found that passing authentication via headers is not working with jQuery ajax with jsonp data type. So tried following and works fine.
$.ajax({
type: "GET",
url: "http://tomcat:tomcat@localhost:1222/testservice/rest/test/users",
dataType:"jsonp",
success: function(res) {
alert(res);
},
error: function(err) {
alert(err);
}
});
function callbackMethod(data) {
alert(data);
}