<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to Make Facebook Apps Using Java &#8211; part 2</title>
	<atom:link href="http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/</link>
	<description>Internet Gaming, Computer Games, Technology, MMO, and Web 2.0</description>
	<lastBuildDate>Sun, 05 Sep 2010 20:30:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: TheGDeveloper</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-6851</link>
		<dc:creator>TheGDeveloper</dc:creator>
		<pubDate>Wed, 14 Jul 2010 12:04:03 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-6851</guid>
		<description>Do you have any idea about why both 
String fb_session_key = request.getParameter(&quot;fb_sig_session_key&quot;);
String authToken = request.getParameter(&quot;auth_token&quot;);

return null value?</description>
		<content:encoded><![CDATA[<p>Do you have any idea about why both<br />
String fb_session_key = request.getParameter(&#8220;fb_sig_session_key&#8221;);<br />
String authToken = request.getParameter(&#8220;auth_token&#8221;);</p>
<p>return null value?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-2515</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sun, 08 Feb 2009 11:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-2515</guid>
		<description>I&#039;m tryng to download the source: 
 source code for FacebookLoginServlet.java.

But the link doesn&#039;t work...where can I find it?
Thanks</description>
		<content:encoded><![CDATA[<p>I&#8217;m tryng to download the source:<br />
 source code for FacebookLoginServlet.java.</p>
<p>But the link doesn&#8217;t work&#8230;where can I find it?<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-1736</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 21 Apr 2008 21:17:41 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-1736</guid>
		<description>I am trying re-do this example using the JSF framework but am having some difficulty with the
response.sendRedirect(loginUrl)

Facebook seems to be embedding their own page.  So instead of redirecting the whole page it only redirects where it is getting my pages content from.  Any ideas?</description>
		<content:encoded><![CDATA[<p>I am trying re-do this example using the JSF framework but am having some difficulty with the<br />
response.sendRedirect(loginUrl)</p>
<p>Facebook seems to be embedding their own page.  So instead of redirecting the whole page it only redirects where it is getting my pages content from.  Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: albert</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-1710</link>
		<dc:creator>albert</dc:creator>
		<pubDate>Wed, 02 Apr 2008 07:41:17 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-1710</guid>
		<description>This is a very nice article and guide, keep up the good work.
I however, do noticed the overly used J2EE word here which might confuse your readers that you need a J2EE server. A normal java web server would&#039;ve been able to do the job too.</description>
		<content:encoded><![CDATA[<p>This is a very nice article and guide, keep up the good work.<br />
I however, do noticed the overly used J2EE word here which might confuse your readers that you need a J2EE server. A normal java web server would&#8217;ve been able to do the job too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shel</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-1295</link>
		<dc:creator>Shel</dc:creator>
		<pubDate>Tue, 05 Feb 2008 05:29:17 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-1295</guid>
		<description>I have the same problem as Joe. I had an app set to FBML. When login is needed, the FB login page shows up in canvas, instead of the main browser page. Thus causing error because the canvas cannot show a full-blown html page. How to correct this? (I have login redirect response.sendRedirect(...)).</description>
		<content:encoded><![CDATA[<p>I have the same problem as Joe. I had an app set to FBML. When login is needed, the FB login page shows up in canvas, instead of the main browser page. Thus causing error because the canvas cannot show a full-blown html page. How to correct this? (I have login redirect response.sendRedirect(&#8230;)).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asaf</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-1072</link>
		<dc:creator>Asaf</dc:creator>
		<pubDate>Thu, 24 Jan 2008 10:51:44 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-1072</guid>
		<description>The problem is that the redirect happens WITHIN the iFrame, thus getting the FB login form and the FB homepage (after the login) INSIDE the iFrame.</description>
		<content:encoded><![CDATA[<p>The problem is that the redirect happens WITHIN the iFrame, thus getting the FB login form and the FB homepage (after the login) INSIDE the iFrame.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: laurent</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-373</link>
		<dc:creator>laurent</dc:creator>
		<pubDate>Sun, 30 Dec 2007 13:30:17 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-373</guid>
		<description>Ajay, I&#039;m using Spring and I&#039;m looking into session-scoped beans, but I do not understand how you did the &quot;In the constructor do everything to create and authenticate session but no utility call.&quot; part : for this, you need access to the request/response objects..... how do you get access to them within your session-scoped bean ?

thanks</description>
		<content:encoded><![CDATA[<p>Ajay, I&#8217;m using Spring and I&#8217;m looking into session-scoped beans, but I do not understand how you did the &#8220;In the constructor do everything to create and authenticate session but no utility call.&#8221; part : for this, you need access to the request/response objects&#8230;.. how do you get access to them within your session-scoped bean ?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rr</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-63</link>
		<dc:creator>rr</dc:creator>
		<pubDate>Wed, 31 Oct 2007 14:47:01 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-63</guid>
		<description>Very helpful post for those starting with facebook app using java.

One suggestion - here is a better alternative to doing the authentication in a servlet. Since it&#039;s a &quot;cross cutting concern&quot; across the application so it&#039;s best handled by intercepting all the requests using a servlet filter. Have a look at this :

http://theliveweb.net/blog/2007/10/31/facebook-authentication-using-java/</description>
		<content:encoded><![CDATA[<p>Very helpful post for those starting with facebook app using java.</p>
<p>One suggestion &#8211; here is a better alternative to doing the authentication in a servlet. Since it&#8217;s a &#8220;cross cutting concern&#8221; across the application so it&#8217;s best handled by intercepting all the requests using a servlet filter. Have a look at this :</p>
<p><a href="http://theliveweb.net/blog/2007/10/31/facebook-authentication-using-java/" onclick="javascript:pageTracker._trackPageview('/outbound/comment/http://theliveweb.net/blog/2007/10/31/facebook-authentication-using-java/');" rel="nofollow">http://theliveweb.net/blog/2007/10/31/facebook-authentication-using-java/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-33</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Thu, 27 Sep 2007 21:01:27 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-33</guid>
		<description>Question for Ajay - did you extend the dispatcher servlet to redirect to the facebook login page if they are not logged in or if the session doesn&#039;t have the credentials?  Your method makes perfect sense if the restclient can be successfully created and then it is available throughout your app, but I don&#039;t understand how you handle the case where the user needs to login</description>
		<content:encoded><![CDATA[<p>Question for Ajay &#8211; did you extend the dispatcher servlet to redirect to the facebook login page if they are not logged in or if the session doesn&#8217;t have the credentials?  Your method makes perfect sense if the restclient can be successfully created and then it is available throughout your app, but I don&#8217;t understand how you handle the case where the user needs to login</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-29</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Wed, 26 Sep 2007 13:16:35 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-29</guid>
		<description>Sorry I&#039;ve figured this out, I had the application set to FBML rather than iFrame so it was rendering the content

One to watch out for I guess...</description>
		<content:encoded><![CDATA[<p>Sorry I&#8217;ve figured this out, I had the application set to FBML rather than iFrame so it was rendering the content</p>
<p>One to watch out for I guess&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-28</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Wed, 26 Sep 2007 11:10:17 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-28</guid>
		<description>I am having an issue during re-direction because the user is not logged in:

				logger.info( &quot;User is not logged in; redirecting them to Facebook&#039;s login page = &quot;+defaultLoginPage );
				resp.sendRedirect(defaultLoginPage);

The problem is that rather than logging in seamlessly and going to the canvas, when I select my application from the applications toolbar, Facebook throws an error:

Errors while loading page from application
Runtime errors:

HTML tag not supported: &quot;title&quot;

HTML tag not supported: &quot;meta&quot;
......

What it appears to be doing is attempting to render the login page in the iframe instead of going there to authenticate and returning to render the canvas. 

Any ideas what I could be doing wrong?</description>
		<content:encoded><![CDATA[<p>I am having an issue during re-direction because the user is not logged in:</p>
<p>				logger.info( &#8220;User is not logged in; redirecting them to Facebook&#8217;s login page = &#8220;+defaultLoginPage );<br />
				resp.sendRedirect(defaultLoginPage);</p>
<p>The problem is that rather than logging in seamlessly and going to the canvas, when I select my application from the applications toolbar, Facebook throws an error:</p>
<p>Errors while loading page from application<br />
Runtime errors:</p>
<p>HTML tag not supported: &#8220;title&#8221;</p>
<p>HTML tag not supported: &#8220;meta&#8221;<br />
&#8230;&#8230;</p>
<p>What it appears to be doing is attempting to render the login page in the iframe instead of going there to authenticate and returning to render the canvas. </p>
<p>Any ideas what I could be doing wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-19</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Mon, 10 Sep 2007 00:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-19</guid>
		<description>Yes, the UK is generally useless for hosting of any kind. Too many people are willing to pander to the greedy and lazy hosting companies that charge twice the going rate for half the service.

My advice: pay in dollars, and you&#039;ll find the service improves *dramatically*. Even when running companies, we&#039;ve nearly always done all hosting in the USA - servers in the US are so much better for the same price that you end up getting similar levels of service despite them being thousands of miles away.</description>
		<content:encoded><![CDATA[<p>Yes, the UK is generally useless for hosting of any kind. Too many people are willing to pander to the greedy and lazy hosting companies that charge twice the going rate for half the service.</p>
<p>My advice: pay in dollars, and you&#8217;ll find the service improves *dramatically*. Even when running companies, we&#8217;ve nearly always done all hosting in the USA &#8211; servers in the US are so much better for the same price that you end up getting similar levels of service despite them being thousands of miles away.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete Hawdon</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-18</link>
		<dc:creator>Pete Hawdon</dc:creator>
		<pubDate>Fri, 07 Sep 2007 11:14:16 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-18</guid>
		<description>Adam - Are you in the US ? I&#039;m in the UK and find it very difficult to find web hosting with J2EE support.</description>
		<content:encoded><![CDATA[<p>Adam &#8211; Are you in the US ? I&#8217;m in the UK and find it very difficult to find web hosting with J2EE support.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil Benn</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-15</link>
		<dc:creator>Neil Benn</dc:creator>
		<pubDate>Sun, 02 Sep 2007 21:08:12 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-15</guid>
		<description>Hello,

          I&#039;m hoping someone here could help!  I&#039;ve been following the examples listed here (thanks for putting them up - they are great).  However I&#039;m running into a  problem.  Following is the code (which I have cut down from your givn example and hardcoded in the API key for simplicity sake) : 

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws IOException{
		
		
		logger.info(&quot;Requested URL: &quot; + req.getRequestURL()
				+ &quot; --- with query string: &quot; + req.getQueryString());
		String authToken = req.getParameter(&quot;auth_token&quot;);

		try{
			if(authToken == null &#124;&#124; authToken.length() </description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>          I&#8217;m hoping someone here could help!  I&#8217;ve been following the examples listed here (thanks for putting them up &#8211; they are great).  However I&#8217;m running into a  problem.  Following is the code (which I have cut down from your givn example and hardcoded in the API key for simplicity sake) : </p>
<p>	@Override<br />
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)<br />
			throws IOException{</p>
<p>		logger.info(&#8220;Requested URL: &#8221; + req.getRequestURL()<br />
				+ &#8221; &#8212; with query string: &#8221; + req.getQueryString());<br />
		String authToken = req.getParameter(&#8220;auth_token&#8221;);</p>
<p>		try{<br />
			if(authToken == null || authToken.length()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajay</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-9</link>
		<dc:creator>Ajay</dc:creator>
		<pubDate>Sat, 25 Aug 2007 15:07:30 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-9</guid>
		<description>If you do use the technique discussed in
http://www.memestorm.com/blog/session-scoped-beans-in-spring-20/
do remember not to make it singleton as you would need one authentication per user. so use only the first technique in the article.</description>
		<content:encoded><![CDATA[<p>If you do use the technique discussed in<br />
<a href="http://www.memestorm.com/blog/session-scoped-beans-in-spring-20/" onclick="javascript:pageTracker._trackPageview('/outbound/comment/http://www.memestorm.com/blog/session-scoped-beans-in-spring-20/');" rel="nofollow">http://www.memestorm.com/blog/session-scoped-beans-in-spring-20/</a><br />
do remember not to make it singleton as you would need one authentication per user. so use only the first technique in the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajay</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-8</link>
		<dc:creator>Ajay</dc:creator>
		<pubDate>Sat, 25 Aug 2007 14:18:23 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-8</guid>
		<description>Adam
In its core you still store the authentication in session but you can avoid the code duplication of checking the session for every servlet.
Example:
I am using spring and hence I can define the scope of the bean as session just by the XML configuration. see a good discussion here

http://www.memestorm.com/blog/session-scoped-beans-in-spring-20/

Even If you are not using it could be implemented in similar manner.
I First extend the FacebookRestClient 
public class FaceBookClient extends FacebookRestClient {
..
}

then define its mapping

In the constructor do everything to create and authenticate session but no utility call.

Also I use a central servlet for all requests. 	
This goes in web.xml
 
    app
    org.springframework.web.servlet.DispatcherServlet
    2
  

  
    app
    *.html
  

In which I inject through setter depndency injection the class I created above.

and now whenever you want to make a call get the available bean and you are ready to go.

Now its available to my whole application authenticated</description>
		<content:encoded><![CDATA[<p>Adam<br />
In its core you still store the authentication in session but you can avoid the code duplication of checking the session for every servlet.<br />
Example:<br />
I am using spring and hence I can define the scope of the bean as session just by the XML configuration. see a good discussion here</p>
<p><a href="http://www.memestorm.com/blog/session-scoped-beans-in-spring-20/" onclick="javascript:pageTracker._trackPageview('/outbound/comment/http://www.memestorm.com/blog/session-scoped-beans-in-spring-20/');" rel="nofollow">http://www.memestorm.com/blog/session-scoped-beans-in-spring-20/</a></p>
<p>Even If you are not using it could be implemented in similar manner.<br />
I First extend the FacebookRestClient<br />
public class FaceBookClient extends FacebookRestClient {<br />
..<br />
}</p>
<p>then define its mapping</p>
<p>In the constructor do everything to create and authenticate session but no utility call.</p>
<p>Also I use a central servlet for all requests.<br />
This goes in web.xml</p>
<p>    app<br />
    org.springframework.web.servlet.DispatcherServlet<br />
    2</p>
<p>    app<br />
    *.html</p>
<p>In which I inject through setter depndency injection the class I created above.</p>
<p>and now whenever you want to make a call get the available bean and you are ready to go.</p>
<p>Now its available to my whole application authenticated</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-7</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Sat, 25 Aug 2007 11:54:31 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-7</guid>
		<description>Go ahead, Ajay. Any extra help on getting facebook apps working is greatly appreciated :).</description>
		<content:encoded><![CDATA[<p>Go ahead, Ajay. Any extra help on getting facebook apps working is greatly appreciated :).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajay</title>
		<link>http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/comment-page-1/#comment-6</link>
		<dc:creator>Ajay</dc:creator>
		<pubDate>Sat, 25 Aug 2007 02:30:39 +0000</pubDate>
		<guid isPermaLink="false">http://tmachine1.dh.bytemark.co.uk/blog/?p=20#comment-6</guid>
		<description>If you are using a central controller servlet as a dispatcher to your different forms authentication will work throughout your application. Let me know if you guys/girls want me to post an example.</description>
		<content:encoded><![CDATA[<p>If you are using a central controller servlet as a dispatcher to your different forms authentication will work throughout your application. Let me know if you guys/girls want me to post an example.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
