• 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: netBrackets <email@hidden>
  • Date: Thu, 14 Feb 2008 09:39:05 -0800

Cool, thanks, I'll give that a shot.

Do you think it would be worth posting the final code if I get it working?  Or maybe a short "HowTo" on the wiki disucssing creating a facebook integrated application, including how to setup things on the facebook side and in  your project?  Being it's a public app that anyone could develop a webobjects app for maybe folks would be interested?

Jeff

On Thursday, February 14, 2008, at 08:18AM, "Mike Schrag" <email@hidden> wrote:
>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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Servlet HttpSession in webobjects?
      • From: Mike Schrag <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>)
 >Re: Servlet HttpSession in webobjects? (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: Rapid Turnaround - RESOLVED BUT RUNS SLOW -
  • 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