• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Servlet HttpSession in webobjects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Servlet HttpSession in webobjects?


  • Subject: Re: Servlet HttpSession in webobjects?
  • From: Jeff Schmitz <email@hidden>
  • Date: Wed, 13 Feb 2008 22:31:19 -0600

Ok,  after a little more study, I don't think I've been explaining things quite right, although I think ultimately I still have the same basic question.  Anyway, here's the servlet/jsp/j2ee whatever it's called code that works correctly under tomcat, and that I want to implement using a webobjects direct action instead:

HttpSession session = request.getSession();
String sessionKey = (String) session.getAttribute("facebookSession");
String token = request.getParameter("auth_token");


if (sessionKey != null && sessionKey.length() > 0) {
facebookRestClient = new FacebookXmlRestClient(apiKey, secretKey, sessionKey);


}
else if (token != null) {
facebookRestClient = new FacebookXmlRestClient(apiKey, secretKey);
session.setAttribute("facebookSession", sessionKey);


    try {
    sessionKey = facebookRestClient.auth_getSession(token);
    session.setAttribute("facebookSession", sessionKey);
    } catch (FacebookException e) {
    e.printStackTrace();
    }
} else {
response.sendRedirect("http://www.facebook.com/login.php?api_key=" 
+ apiKey + "&v=1.0");
return;
}
                response.getWriter().println("Hello World");

Where I think I wasn't quite is I think that the jsp code above (i.e. my code) DOES originally create the session ID.  However, it uses an HttpSession object to pass it to facebook.  So, the question remains basically, how can webobjects mimic the functionality of an HttpSession object?  Below I've pasted the key line of code that I'm unsure of how to do using webobjects:

session.setAttribute("facebookSession", sessionKey);

Or perhaps facebook doesn't really care?  It's my session ID after all, but then again, maybe it's I that will need the session ID back from facebook.  My brain is starting to hurt.

Thanks,
Jeff
 _______________________________________________
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

  • Follow-Ups:
    • Re: Servlet HttpSession in webobjects?
      • From: Mike Schrag <email@hidden>
    • Re: Servlet HttpSession in webobjects?
      • From: Lachlan Deck <email@hidden>
References: 
 >Re: AJAX WebObjects Integration (From: Jeff Schmitz <email@hidden>)
 >Servlet HttpSession in webobjects? (From: Jeff Schmitz <email@hidden>)
 >Re: Servlet HttpSession in webobjects? (From: Lachlan Deck <email@hidden>)
 >Re: Servlet HttpSession in webobjects? (From: Jeff Schmitz <email@hidden>)
 >Re: Servlet HttpSession in webobjects? (From: Lachlan Deck <email@hidden>)
 >Re: Servlet HttpSession in webobjects? (From: Jeff Schmitz <email@hidden>)
 >Re: Servlet HttpSession in webobjects? (From: Mike Schrag <email@hidden>)
 >Re: Servlet HttpSession in webobjects? (From: Jeff Schmitz <email@hidden>)
 >Re: Servlet HttpSession in webobjects? (From: Chuck Hill <email@hidden>)
 >Re: Servlet HttpSession in webobjects? (From: Jeff Schmitz <email@hidden>)
 >Re: Servlet HttpSession in webobjects? (From: Mike Schrag <email@hidden>)
 >Re: Servlet HttpSession in webobjects? (From: Jeff Schmitz <email@hidden>)
 >Re: Servlet HttpSession in webobjects? (From: Mike Schrag <email@hidden>)
 >Re: Servlet HttpSession in webobjects? (From: "Mr. Pierre Frisch" <email@hidden>)

  • Prev by Date: Re: DirectAction & User login Questions.
  • Next by Date: Re: Servlet HttpSession in webobjects?
  • Previous by thread: Re: Servlet HttpSession in webobjects?
  • Next by thread: Re: Servlet HttpSession in webobjects?
  • Index(es):
    • Date
    • Thread