App Engine Java Basics
Training Exercise #2
Protecting Applications
Pre-reqs:
- Install Eclipse IDE for Java EE Developers (Indigo): Eclipse Download Site
- Install Google Eclipse Plugin: Google Plugin instructions
- Create application for use during tutorials [i.e. <username>-gae-exercise.appspot.com]
- 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)
- Use the exercise you just finished in #1 (or start with the same starter project)
- Update the web.xml to secure the entire application (make it /*)

- 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.

- Now, select your project folder in the Project Explorer, and click the
icon to run locally in debug mode.

- Notice how it asks you to login (if you are not already logged in) as soon as you go to the site.

- Login with any e-mail address for testing purposes, and post a couple messages to test the system out.

- 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...”

- (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/)
- Run a couple tests to see how it performs.
You have completed the exercise!