2009-06-03 212 views

回答

2

春季社交很棒,但只适用于Spring Framework 3.0+。所以,看你的春季版本,因为我想两天弄清楚如何使弹簧社会与Spring框架2.5工作;)

0

您可以使用facbook图形API请求用户信息和比对其进行分析是这样的:

 JSONObject resp = new JSONObject(content); 
     String facebookid = resp.getString("id"); 
     String firstName = resp.getString("first_name"); 
     String lastName = resp.getString("last_name"); 
     String email = resp.getString("email"); 
     String phone = resp.getString("mobile_phone"); 

     JSONObject address = resp.getJSONObject("address"); 
     String street = address.getString("street"); 
     String city = address.getString("city"); 
     String zip = address.getString("zip"); 
     String state = address.getString("state"); 
     String country = address.getString("country"); 

当你有字符串调用你的注册方法应该很容易。比你只需要自动认证他们。

我已经张贴了关于这个在这里更多的细节: Facebook Connect example in JSP (tomcat)