2009-06-03 88 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)