Creating a Guestbook Application

This tutorial shows the code you need to implement a simple Java application for Google App Engine--a guestbook that lets users post messages to a public message board. It uses javax.servlet and JavaServer Pages (JSP).

In this code walkthrough, you:

  • Clone the tutorial project.
  • Learn about core features of App Engine called out in key parts of the project.
  • Run, test, and deploy the project.

The tutorial assumes that you are familiar with Java.

The UI for the application looks like this:

Hello_UI

Objectives

  • Walk through an Apache Maven project to view an App Engine project with the required layout and files.
  • Understand the servlet code and JSP templates that respond to user requests.
  • Understand the integration with Google Accounts for user authentication.
  • Understand how to use Objectify to save data to Google Cloud Datastore.
  • Build and test your app in the local development server.
  • Deploy the app to production Google App Engine.

Costs

App Engine has free a level of usage. If your total usage of App Engine is less than the limits specified in the App Engine free quota, there is no charge for doing this tutorial.

Before you begin

  1. Create or select a Cloud Platform project in the Cloud Platform Console and then ensure that project includes an App Engine application:

    Go to App Engine

    The Dashboard opens if an App Engine application already exists in your project. Otherwise, you are prompted to choose the region where you want your App Engine application located.

  2. Make a note of the project ID, which might be different from the project name. The project ID is used in commands and in configurations.

  3. You should have the Java 7 SDK installed, preferably the Enterprise Edition. For more information, see these download and installation instructions.

  4. You should have Maven 3.3.9 or greater installed. See Setting up Maven.

Cloning the tutorial project

If you haven't already, clone the Guestbook app repository to your local machine and change directory to its final subdirectory:

git clone https://github.com/GoogleCloudPlatform/appengine-java-guestbook-multiphase.git
cd appengine-java-guestbook-multiphase/final

Alternatively, you can download the sample as a zip file and extract it.

The cloned project (or download) contains two sub-projects: final and <