Configuring JavaServer Faces 2.0 to run on the Google App Engine Using NetBeans

***** DRAFT *****

This tutorial will guide users through the process of developing a JavaServer Faces application using Sun Microsystem's final release of the reference implementation for the 2.0 specification.  The application built out in the course of writing this tutorial is available from http://jsf2template.wildstartech.com/.  The source code is available from the jsf2template Google Code project.  This tutorial is tailored for those using the NetBeans IDE.

NOTE: The Google Code project currently houses the Eclipse-based project.  At some future point, the project will be updated to include a merged project that can be opened from either IDE.

Software Requirements

Required Software
In order to build a JavaServer Faces 2.0 application and have it run on the Google App Engine platform, you will need to have the following software downloaded and installed locally.

Pre-Configuration Steps

  1. Download and install either NetBeans 6.7.1 or NetBeans 6.8 Beta 1.
  2. Download the Sun Java ServerFaces 2.0.1 FCS (mojarra-2.0.1-FCS-binary.zipframework and Unified Expression Language (API & Implementation).  Uncompress the archives on your local hard disk drive.

Installing the NetBeans Plugins

The steps provided below will guide you through the process of installing the Netbeans plugins that support developing for the Google AppEngine.

NOTE: The process steps and screen shots were taken using the first beta release of Netbeans 6.8.
  1. Start Netbeans.
  2. Left-click on the 'Tools' menu and select the 'Plugins' menu item.



  3. When the "Plugins" dialog is displayed, left-click on the 'Settings' tab.



  4. Left-click on the 'Add' button located on the right side of the page about two-thirds of the way down.
  5. When the "Update Center Customizer" dialog is displayed, enter "Google AppEngine" in the 'Name' field and "http://kenai.com/projects/nbappengine/downloads/download/Latest_NetBeans68/updates.xml" in the 'URL' field.

  6. Left-click on the 'OK' button.
  7. Left-click on the 'Available Plugins' tab and place check marks beside the following plug-ins.
    • Google App Engine Editor Hints
    • Google App Engine Server
    • Google App Engine Configuration Editor
    • Google App Engine Samples
    • Google App Engine Deployment

  8. Left-click on the 'Install' button.
  9. On the "Welcome to the NetBeans IDE Plugin Installer" window, left-click on the 'Next' button.

  10. When presented with the "License Agreement" page, place a check mark in the box to the left of the "I accept the terms in all of the license agreements" option and left-click on the  'Install' button.


  11. After the plugins are downloaded, you will be presented with a "Validation Warning" dialog.  Left-click on the 'Continue' button.

  12. When presented with the "Installation completed successfully" dialog, left-click on the 'Finish' button.


  13. Left-click on the 'Close' button of the "Plugins" window.

Defining a Local Google App Engine Server

This portion of the document will guide you through the process of configuring a local instance of the Google App Engine server environment.
  1. Left-click on the 'Tools' menu and select the 'Servers' menu item.


  2. When presented with the "Servers" dialog, left-click on the 'Add Server...' button.


  3. Select the "Google App Engine" item from the list of available servers displayed in the "Add Server Instance" dialog.


  4. Left-click on the 'Next' button.
  5. When prompted for the "Server Location", left-click on the 'Browse' button to display the "Choose Google App Engine Location" dialog.
  6. Find the place on your local hard disk drive where you installed the 1.2.6 version of the Google App Engine SDK, select the folder and then left-click on the 'Choose' button.


  7. When returned to the "Add Server Instance" dialog, left-click on the 'Next' button.

  8. Leave the default server properties settings and left-click on the 'Finish' button.

  9. When returned to the "Servers" dialog, you will see the newly added "Google App Engine" option.  Left-click on the 'Javadoc' tab.

  10. Left-click on the 'Add ZIP/Folder...' button.

  11. Navigate to the "docs" folder in the directory on your hard disk drive where you installed the "Google App Engine SDK".
  12. Left-click on the 'javadoc' folder and then left-click on the 'Add ZIP/Folder' button.

  13. Left-click on the 'Close' button to complete the process of adding a local Google App Engine server.

Creating a New Project

Now that we have completed all the pre-configuration tasks, we are ready to create our first Google App Engine project.
  1. Left-click on the 'New Project...' menu item found on the 'File' menu.

  2. When the "New Project" window is displayed, select the "Java Web"  option from the 'Categories' list and "Web Application" from the 'Projects' list.

  3. Left-click on the 'Next' button.
  4. When presented with the "New Web Application" dialog, enter "Google AppEngine JSF 2.0 Template" in the 'Project Name' field.  The value for the 'Project Location' field will be whatever you have defined as your Netbeans workspace.  The 'Project Folder' field will be automatically populated based on what was specified for the 'Project Name' and 'Project Location' fields.

  5. Left-click on the 'Next' button. 
  6. On the "Servers and Settings" dialog, select "Google App Engine" from the menu attached to the 'Server' field.

  7. Leave the 'Java EE' field set equal to "Java EE 5".
  8. Change the vale in the 'Context Path' field from "/Google_ AppEngine_JSF_2.0_Template" to simply "/".
  9. Left-click on the 'Next' button.
  10. In the "Frameworks" dialog, place a check mark to the left of the "JavaServer Faces" option.

  11. Under the "JavaServer Faces Configuration" section of the dialog, select "JSF 2.0" from the menu attached to the 'Registered Libraries' field.
  12. Left-click on the 'Finish' button.
Comments