Hi Guys,
I have the following scenario. I have a website, let's call it www.example-a.com and another one called www.example-b.com.
a) www.example-a.com needs to make an ajax call to www.example-b.com
b) www.example-b.com sends a json data back to www.example-a.com
When I do my ajax call from www.example-a.com like this:
PHP Code:
$.getJSON( 'http://www.example-b/user/list', function( data ) {
$.each( data, function( key, user ) {
console.log( 'user name: '+user.username );
});
});
The response on www.example-a.com is: STATUS 200 OK.
My method call in the controller is this one:
PHP Code:
@Controller
@RequestMapping("/user")
public class UserController {
...
@RequestMapping( value="/list", method=RequestMethod.GET )
public @ResponseBody List<User> list() {
return userService.list();
}
...
}
The response Headers are this one:
Code:
Date Wed, 18 Jan 2012 08:29:25 GMT
Content-Type application/json;charset=UTF-8
Transfer-Encoding chunked
Connection Keep-Alive
Request Headers
Host www.example-b.com
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Accept application/json, text/javascript, */*; q=0.01
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection keep-alive
Origin null
But the Response is empty! 
I thought it's related to a RESTful approach. Since I've never done a RESTful implementation, I thought somebody can give me hint to do it.
I would appreciate any comments and help.