http://www.menofactionscript.com/index.php/2011/03/13/google-appengine-getting-started-2 1340703668 item_IDs_on_this_page:32 Content-type: text/html; charset=iso-8859-1 Google App Engine Getting Started #2
« Google App Engine Getting Started #3Google App Engine Hello World »

Google App Engine Getting Started #2

Permalink 03/13/11 13:10, by alevicki, Categories: Google App Engine , Tags: appengine, eclipse, google, web.xml

For this post I tackled the 2nd part of the App Engine getting started guide located here: http://code.google.com/appengine/docs/java/gettingstarted/usingusers.html

I didn't follow their instructions exactly.  Instead of modifying my existing servlet, located here:

http://alevicki.appspot.com/googleappenginealevicki

I decided to create an additional servlet for the new functionality.  Because of this I had to make some changes to my existing web.xml that were not included in the getting started guide.  You can find my modified web.xml below.

In addition, instead of just saying "Hello, Nickname" I decided that I would expose some of the other fields on the User object.  These included auth domain, federated identity, user id, and email address.  I was surprised by the length of the user id, as it implies Google could support an astronomical number of users unless they are somehow encoding additional information into the id, which would be rather odd.

The hello user servlet is located here: http://alevicki.appspot.com/hellouser.  It will redirect you to a Google sign in page if you do not already have an active session.  This is accomplished using the userService.createLoginURL as described in the getting started guide.

Updated web.xml:

<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
	<servlet>
		<servlet-name>GoogleAppEngineAlevicki</servlet-name>
		<servlet-class>com.menofactionscript.GoogleAppEngineAlevickiServlet</servlet-class>
	</servlet>
	<servlet>
		<servlet-name>HelloUser</servlet-name>
		<servlet-class>com.menofactionscript.HelloUser</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>GoogleAppEngineAlevicki</servlet-name>
		<url-pattern>/googleappenginealevicki</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>HelloUser</servlet-name>
		<url-pattern>/hellouser</url-pattern>
	</servlet-mapping>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
</web-app>


 

No feedback yet

June 2012
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Search

XML Feeds

multiblog

©2012 by Alan Levicki

Contact | Help | Blog theme by Asevo | multiple blogs | webhosting