Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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/Image Removed

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");
}