Geronimos Web Tier


Geronimo’s Web Tier

The Web tier is where the user’s browser meets the Geronimo server. Of course, other than users on browsers, an automated program can also make connections to the Web tier for information over the HTTP protocol. Non-browser-based access is typically done through Web services, which is discussed later on in this chapter.

The Web tier is also where most presentation layer components will reside. User interface technologies such as JavaServer Pages (JSPs), JavaServer Faces (JSFs), Struts, Tile, Direct Web Remoting (DWR), Velocity, and Tapestry all work at this tier.

Depending on the server-side configuration, there may be a front-end Web server that forwards requests to Geronimo for processing (see Figure 4-2).

image from book
Figure 4-2: User access Geronimo through the Web tier

The Web-tier containers in Geronimo, however, are also capable of serving as a standalone Web server if necessary. Figure 4-2 illustrates this as an alternative via dotted lines. For sites where most of the pages are dynamically generated using JSP or other presentation technology, this built-in solution may suffice.

Increasingly, developers are turning toward lightweight server solutions, where the entire application is coded to be executed within the Web container. By leaving out the baggage of the business tier and the EIS tier, a lot of complex coding and large library code can be eliminated in the final application. This allows applications to be distributed and executed with smallest possible memory and disk footprint. Geronimo fully supports these lightweight applications at the Web tier. In fact, Geronimo 1.1 has a Little-G minimal server distribution that can run lightweight solutions with no baggage beyond a Web-tier server (your choice of Tomcat or Jetty).

Components Deployable at the Web Tier

Web applications are made out of software components. The software components that may be deployed as part of application at the Web tier include:

  • Servlets

  • JSP

A servlet is really a Java class coded to special conventions (implementing the Servlet interface). Since a servlet may depend on other Java classes and libraries to operate, the application deployment will always need to include these dependent code modules.

There are many developer frameworks that are built using JSP and servlets. This includes Struts, Tiles, JSF, DWR, Velocity, Tapestry, and so on. Applications built using these frameworks, therefore, can also be deployed at the Web tier.

Before the software components can be deployed to the Geronimo Web-tier container, they must be bundled up in an archive. The J2EE specification requires the modules to be bundled in the JAR format and that they be named with the extension .war. These are called Web application archive (WAR) files. A WAR file needs to be laid out in a very specific format, including a required standard deployment descriptor (web.xml) in the WEB-INF directory within the archive.

Most modern development tools will create WAR files for software projects automatically. As an administrator, you will seldom need to work with a disassembled WAR file. Your development team should supply deployable Web applications in the form of WAR files.

Thus far, Geronimo’s Web-tier container has been mentioned without naming a specific implementation. The next section describes the two choices that you have, when working with Geronimo, for the Web-tier container.

Tomcat and Jetty - Web-Tier Containers

At the Web tier, Geronimo uses two well-known containers:

  • Apache Tomcat

  • Jetty

You have the option, when you download Geronimo, to select either the binary distribution with Tomcat already integrated as the Web-tier container or the binary with Jetty integrated.

Tomcat at the Web Tier

Apache Tomcat is an ASF Open Source servlet/JSP container project. You can get all the project information you need on the official Web site:

http://tomcat.apache.org/

Geronimo 1.1 integrated the latest 5.5 release of Tomcat as its Web container. This version of Tomcat supports the Servlet 2.4 and JSP 2.0 standards. Any Web application coded to these standards can be deployed to Tomcat/Geronimo.

The Tomcat integration supports the following advanced features of the Tomcat container:

  • Multiple simultaneous protocol connectors (HTTP, SSL, AJP1.3, and so on)

  • Virtual hosts

  • Realms

  • Valves

  • Clustering

Furthermore, the Tomcat integration takes advantage of Geronimo’s container services. This integration provides access to the Java Naming and Directory Interface (JNDI), security, and transaction services of Geronimo.

Chapter 11 provides detail information on the configuration of the Tomcat server inside Geronimo.

Jetty at the Web Tier

Jetty is a popular Open Source lightweight servlets and JSP container. Jetty was developed by the principals of MortBay, a company based with offices in the UK and Australia. Jetty is released under the Apache License 2.0. You can get the Jetty project information at the official Web site:

http://jetty.mortbay.org/

Similar to the Tomcat integration, the Geronimo Jetty integration supports the following advanced features of the Jetty container:

  • Multiple protocol connectors (HTTP, SSL, AJP1.3, and so on)

  • Virtual hosts

The Jetty integration takes full advantage of Geronimo’s container services. You will have full access to the JNDI, security, and transaction services of Geronimo when configuring Jetty components.

Chapter 10 provides detailed information on the configuration of the Jetty server inside Geronimo.




Professional Apache Geronimo
Professional Apache Geronimo (Wrox Professional Guides)
ISBN: 0471785431
EAN: 2147483647
Year: 2004
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net