Re: Servlet HttpSession in webobjects?
Re: Servlet HttpSession in webobjects?
- Subject: Re: Servlet HttpSession in webobjects?
- From: Lachlan Deck <email@hidden>
- Date: Thu, 14 Feb 2008 16:22:16 +1100
Hi Jeff,
On 14/02/2008, at 3:31 PM, Jeff Schmitz wrote:
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.
I think we do too :-)... i.e., have you debugged the incoming
WORequest, printed it out, and seen what headers/formValues you are
receiving from the remote app? Theory becomes a lot easier with a
little testing ;-)
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();
So does the above create a session if one doesn't exist?
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 {
Or in fact it looks like you're being given a sessionID here... If
that's the case, then I'm back to my first question.
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.
Doesn't look that way to me. It looks like it's given a sessionID via
authentication with the remote app.
However, it uses an HttpSession object to pass it to facebook.
Please try to see what happens if you create an instance of
WOServeletContext.
with regards,
--
Lachlan Deck
_______________________________________________
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