Skip to content

Instantly share code, notes, and snippets.

@modulo5
modulo5 / facebook.jsp
Created June 6, 2011 04:33
Java Facebook Authentication
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" import="com.google.gson.Gson,javax.servlet.http.Cookie,java.net.URL,java.net.URLDecoder,java.security.*,java.io.*,java.util.* "%>
<%!
static final String YOUR_APP_ID = "YOUR_FACEBOOK_APP_ID_HERE";
static final String YOUR_APP_SECRET = "YOUR_FACEBOOK_APP_SECRET_HERE";
class FacebookUser {
String id;
String name;
package com.gavinminami.gwtdemo.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
public class PingDemo implements EntryPoint {
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Pageview Counter</title>
<script type="text/javascript" language="javascript" src="gwtdemo/gwtdemo.nocache.js"></script>
<style>
body {
package com.gavinminami.gwtdemo.server;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import java.util.logging.Logger;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
package com.gavinminami.gwtdemo.server;
import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.Key;
package com.gavinminami.gwtdemo.client;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
@RemoteServiceRelativePath("greet")
public interface PingService extends RemoteService {
Integer ping(String hostUrl) throws IllegalArgumentException;
}