HttpServletResponse response = (HttpServletResponse) res;
HttpSession session = request.getSession();
String sessionKey = (String) session
.getAttribute(FacebookUtil.SESSION_KEY);
String authToken = request.getParameter(FacebookUtil.AUTH_TOKEN);
FacebookXmlRestClient client = null;
if (sessionKey != null) {
client = new FacebookXmlRestClient(API_KEY, SECRET_KEY, sessionKey);
} else if (authToken != null) {
client = new FacebookXmlRestClient(API_KEY, SECRET_KEY);
try {
sessionKey = client.auth_getSession(authToken);
session.setAttribute(FacebookUtil.SESSION_KEY, sessionKey);
} catch (Exception e) {
e.printStackTrace();
}
} else {
IFacebookRestClient<Document> userClient = FacebookUtil
.getUserClient(session);
if (userClient == null) {
userClient = new FacebookXmlRestClient(API_KEY, SECRET_KEY);
session.setAttribute(FacebookUtil.FACEBOOK_USER_CLIENT,
userClient);
}
/*
*