your Session.java:
public class Session extends WOSession {
private String _facebookSession;
...
public void setFacebookSession(String facebookSession) {
_facebookSession = facebookSession;
}
public String facebookSession() {
return _facebookSession;
}
}
HttpSession session = request.getSession();
Session session = (Session)session();
String sessionKey = (String)
session.getAttribute("facebookSession");
String sessionKey = session.facebookSession();
String token = request.getParameter("auth_token");
String token = request.stringFormValueForKey("auth_token");
if (sessionKey != null && sessionKey.length() > 0) {
facebookRestClient = new FacebookXmlRestClient(apiKey, secretKey,
sessionKey);
}
else if (token != null) {
facebookRestClient = new FacebookXmlRestClient(apiKey,
secretKey);
above is the same
session.setAttribute("facebookSession", sessionKey);
session.setFacebookSession(sessionKey);
try {
sessionKey = facebookRestClient.auth_getSession(token);
above is the same
session.setAttribute("facebookSession", sessionKey);
session.setFacebookSession(sessionKey);
} catch (FacebookException e) {
e.printStackTrace();
}
} else {
above is the same
response.sendRedirect("http://www.facebook.com/login.php?api_key="
+ apiKey + "&v=1.0");
WORedirect redirect =
(WORedirect)pageWithName(WORedirect.class.getName());
redirect.setUrl("http://www.facebook.com/login.php?api_key=" + apiKey
+ "&v=1.0");
return;
return redirect;
}
response.getWriter().println("Hello World");
return pageWithName("HelloWorldPage");
ms _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]