...
Note: I'm not using the FaceBook client that comes from the FaceBook website. I'm using a version from this website: http://code.google.com/p/facebook-java-api/
This is the application class itself:
...
Code Block |
---|
if (client == null) {
WebMarkupContainer friends = new WebMarkupContainer("friends");
friends.add(new Label("friend", "missing frields"));
} else {
client.friends_get();
FriendsGetResponse fbResponse = (FriendsGetResponse) client.getResponsePOJO();
List<Long> friends = fbResponse.getUid();
add(new ListView("friends", friends) {
protected void populateItem(ListItem listItem) {
listItem.add(new Label("friend", listItem.getModelObjectAsString()));
}
});
}
|
Or, you can force Wicket to redirect to Facebook login page immediately - just change the forceLogin method:
Code Block |
---|
private void forceLogin(Page page) { throw new RedirectToUrlException("http://www.facebook.com/login.php?api_key=" + _apiKey + "&v=1.0"); } |