Re: Servlet HttpSession in webobjects?
Re: Servlet HttpSession in webobjects?
- Subject: Re: Servlet HttpSession in webobjects?
- From: Mike Schrag <email@hidden>
- Date: Thu, 14 Feb 2008 09:18:08 -0500
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 WORedirect redirect = (WORedirect)pageWithName(WORedirect.class.getName()); 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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden