$.getJSON("http://localhost:8080/v1/message",
function(data) {
console.log(data);
alert("message"+data);//this alert stmt is displayed it means that
the service call is getting executed
});
service method
@RequestMapping(method = RequestMethod.GET,
value = "/message" )
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public String message()
{
return "jasdknsd";
}
I am getting response of this call as null please help me out if I am doing something wrong in the service method and I have both of them in same network because of which I am not using callback
Connection to localhost is not supported.
http://code.google.com/p/android/issues/detail?id=133
127.0.0.1is the emulated system’s own loopback interface, not the one running onyour host development machine.
within the Android system, one should use
10.0.2.2which is an alias specificallysetup to contact your host
127.0.0.1