Java Reference
In-Depth Information
Depending on your application's needs, you may or may not choose to use a
framework. You can certainly develop feature-rich, scalable applications for
App Engine using servlets and JSPs. We are going to take a quick peek at some
applications built using the Java Servlet standard, Swing MVC, and Adobe Flex with
GraniteDS.
Servlets and JavaServer Pages
For web applications, the Java Servlet standard is one of the major foundations of
the server stack. By default App Engine utilizes this tried-and-true standard for web
applications as well. As with most servlet containers, App Engine serves up servlets,
JSPs, static files, and other data files from the web archive (WAR) directory based
on the configuration in the deployment descriptor. Gone are the days of manually
configuring and load-balancing your servers based on traffic. A major advantage of
App Engine is that it automatically scales your application for you. Applications run
on multiple web servers simultaneously and Google automatically adjusts the server
pool based on the load.
As with most multitenant environments, App Engine runs the JVM in a secured
“sandbox” environment to isolate applications from one another for security and
service availability. The sandbox ensures that applications don't step on one another,
hog server resources, or perform actions that they shouldn't. These restrictions
can be great for ensuring scalability but can make you want to pull your hair out
sometimes. For instance, applications don't have access to the local file system for
write operations, cannot spawn threads, cannot leverage JNI or other native code,
and cannot make ad hoc network connections. Most of the time it's not an issue, but
in certain cases you'll find yourself wanting to write to the local file system or spawn a
new thread to perform operations more efficiently.
To get started with App Engine, you're going to build a small application
that incorporates some basic functionality. The application is a simple telesales
application that sales representatives can use to field inbound sales calls. Users will
be able to search for existing accounts or create new accounts. They can view existing
sales opportunities for the account or create new opportunities that other sales reps
can follow up on. Your application will contain a single servlet and a number of JSPs.
You'll persist your data to Bigtable. (We'll just skim over the functionality here, as
we'll dig into Bigtable in detail in Chapter 7.)
Views
Starting with the views for your application, the servlet container serves a welcome
page (Figure 4-1 and Listing 4-1), a simple form that allows the user to perform a
 
Search WWH ::




Custom Search