App Engine Java Basics

Training Exercise #2

Protecting Applications

Pre-reqs:

  1. Install Eclipse IDE for Java EE Developers (Indigo): Eclipse Download Site
  2. Install Google Eclipse Plugin: Google Plugin instructions
  3. Create application for use during tutorials  [i.e. <username>-gae-exercise.appspot.com]
  4. With a Gmail account (non Google Apps) create API console project with Cloud Storage and Billing enabled

Exercise #2: Protecting Application

Starting Files: http://code.google.com/p/gae-java-basics-exercise/downloads/detail?name=GAE-Training-Exercise1.zip

(Use the same project you just finished with in Exercise #1)

  1. Use the exercise you just finished in #1 (or start with the same starter project)
  2. Update the web.xml to secure the entire application (make it /*)
  3. Change the war/WEB-INF/appengine-web.xml file to use your own application ID (value before .appspot.com of your application) and update to version 2 and save.
  4. Now, select your project folder in the Project Explorer, and click the  icon to run locally in debug mode.
  5. Notice how it asks you to login (if you are not already logged in) as soon as you go to the site.
  6. Login with any e-mail address for testing purposes, and post a couple messages to test the system out.
  7. Now, select your project folder in the Project Explorer, and click the drop down arrow next to the  icon and select “Deploy to App Engine...

  8. (http://2.gae-java-basics-exercise.appspot.com/). If it also set as Default, you can simply go to your application’s URL (i.e. http://gae-java-basics-exercise.appspot.com/)
  9. Run a couple tests to see how it performs.

    You have completed the exercise!