Professional Documents
Culture Documents
development
Skill Level: Intermediate
Sing Li (westmakaha@yahoo.com)
Author
Wrox Press
27 Feb 2006
To create, test, and deploy a Web-based application or Web service rapidly, you
need a proven relational database, a standards-compliant Web application server,
and a flexible IDE. Ideally, all these software packages are production-tested, simple
to obtain, easy to use, and well integrated with one another. This tutorial shows you
how to use IBM-backed open source and free software to kick-start your Java™
Web-based application development. You'll learn exactly where to download such
components, install them, and get them working for you today.
This is not a secret, and professionals in large IT projects have been enjoying this
proven collection of software for years. But until now, the development community at
large has not had general access to these tools. Times have changed, though, and
today full-featured editions of the servers and IDE in this collection are only a
download away -- free of charge and free of license fees -- with full support from
IBM.
Java developers can now freely use the open source Eclipse IDE to create and test
applications and Web services and then install them to WebSphere Application
Server Community Edition (referred to throughout this tutorial as Application Server)
and DB2 Express-C for production deployment.
Prerequisites
You should be familiar with Java development in general and server-side Java
development specifically. This tutorial assumes that you understand the general
operations of a relational database and are familiar with basic J2EE concepts, such
as deployment descriptors and WAR archives. Experience working with an
application server and relational database is beneficial but not mandatory.
System requirements
To follow along and try out the code for this tutorial, you need a working installation
of Sun's JDK 1.4.2_09 or the IBM JDK 1.4.2 SR3.
The recommended system configuration for trying out the tutorial is:
Section 2. Overview
The Kick-start your Java apps suite of software includes the following products and
versions, which are designed to work well together:
Figure 1 illustrates how these products fit together for server-side Java application
development:
servers
Once you have tested your application in Eclipse, you can deploy it into production
running inside Application Server. Application Server is a J2EE 1.4 compatible
application server that can host applications constructed from Web components
such as JavaServer Pages (JSP), servlets, and Enterprise JavaBeans (EJB). You
can use Eclipse and Application Server with modern, open source, lightweight
frameworks such as the Spring Framework and Hibernate. Application Server also
doubles as a general-purpose Web server for static HTML pages and graphic files.
Users can access your application through a browser pointed to the Application
Server.
Your production applications, hosted on Application Server, can use DB2 Express-C
to store any application data. DB2 Express-C supports Java-based data access
through JDBC. It includes a fully licensed, high-performance type 4, 100% JDBC
driver. This driver works very well with 100% Java applications requiring relational
database management system (RDBMS) access.
Application Server has built-in support for J2EE Connector Architecture (JCA) 1.5
resource adapters and can make use of the DB2 Express-C JDBC driver to provide
data persistence for any hosted application.
There is practically no limit to the size of the databases that you can create and
manage with DB2 Express-C. Depending on your application and database design,
a 32-bit server equipped with 4GB of main memory can readily handle databases
tens of gigabytes in size.
A restriction with DB2 Express-C is the memory size of the hardware on which you
can run the server. The limit of 4GB of physical memory corresponds to the typical
maximum addressable memory space for many 32-bit operating systems.
If your needs grow past this range of capacity, chances are you need to look beyond
32-bit server hardware and operating systems anyway. The DB2 Universal
Database family of products provides a smooth, scalable growth path without the
need to tackle costly and often risky data conversion.
If you do not yet have an IBM ID, you need to register before downloading DB2
Express-C. Registration is free and takes just minutes.
Before you proceed any further, you need to be aware that DB2 Express-C uses the
operating system's authentication system to authenticate users. In the case of
Windows, it uses the name of the logged-in Windows user. Any tables that you build
in the database are created under a schema with that username. For this tutorial,
make sure you are logged on to Windows as the same user who will create the
application. This eliminates the need to assign a specific level of privileges for your
explorations.
You should read the installation prerequisites, verify that your hardware and
software satisfy them, and read the release notes. Then click Install Product.
When prompted, select the Typical installation type, shown in Figure 3. This option
takes up to 500MB of disk space.
The next screen prompts you for an installation directory. The default is the Program
Files\IBM\SQLLIB\ directory on the system drive. This tutorial refers to this directory
as the SQLLIB directory.
In the future, when you install production server instance(s), you should consult the
DB2 Administration Server User Guide to determine the security scenario most
applicable to your installation.
• A new green DB2 tray icon (lower right-hand side of the screen next to
the system clock)
• A new menu named IBM DB2 with a variety of administrative and user
tools (under the Windows Start menu)
Setup Tools > First Steps from your Windows Start menu.
This starts the First Steps wizard. Select Create Sample Database from the
left-hand menu. The wizard proceeds to create a database called SAMPLE.
Table 1 describes the system services that are installed on your system:
If you examine the Windows Task Manager's task list (type Ctrl-Alt-Delete to invoke
the Task Manager), you'll see several of these services running.
Development support
Java development support in DB2 Express-C includes access through JDBC (a type
4 driver and a type 2 driver are available) and SQLJ static embedded SQL. Windows
.NET developers can use the add-in support for development using the Microsoft
Visual Studio .NET development environment. Open source developers can take
advantage of the support for development using popular scripting environments,
including Perl, PHP, Python, and Ruby.
GUI-based tools
Table 2 briefly describes some of the GUI tools provided with DB2 Express-C. You
can explore these tools at your leisure:
To start the CLP, select IBM DB2 > Command Line Tools > Command Line
Processor from the Windows Start menu. Alternatively, assuming you have set up
your environment PATH variable to include SQLLIB\BIN, you can use the following
command:
db2
Figure 7 shows the result of this command. You are now connected to the SAMPLE
database:
You can directly enter SQL queries against the table. Try the following:
select * from employee where empno='000300'
In Figure 8, the result is the record for Philip Smith, who has the employee number
of 000300.
Figure 8 also illustrates the query to find all the employees with an annual salary of
$40,000 or more:
select firstname, lastname, salary from employee where salary > 40000
See Figure 8 for the result, showing four employees with salaries greater than
$40,000.
This command shows the fields structure of the EMPLOYEE table, as shown in Figure
9:
The application you'll work through later in this tutorial makes use of the EMPLOYEE
table.
The products.sql script file, found in the sql subdirectory of the code download for
this article (see Download), is shown in Listing 1:
Listing 1. The products.sql DB2 CLP script file for creating a table
CONNECT TO SAMPLE;
DROP TABLE PRODUCTS;
CREATE TABLE PRODUCTS (
SKU CHAR(15) NOT NULL,
DESCRIPTION VARCHAR(80) NOT NULL,
PRICE DECIMAL(10,2),
PRIMARY KEY(SKU)
);
This standard SQL script file connects to the SAMPLE database, creates a table
called PRODUCTS, and places three rows in the table.
The DB2 CLP can process this script. Just enter the following command:
db2 -vf products.sql -t
Figure 10. Processing a DB2 command script file using the CLP
You can get more information on the options available with the CLP from the
Information Center. You can also explore the newly created database visually with
the Control Center.
The next section examines another important engine for your Web applications:
WebSphere Application Server Community Edition.
1.4 compatible application server and a member of the IBM WebSphere family of
products. This section introduces you to Application Server's structure and
functionality. If you prefer to use a different application server for the purposes of this
tutorial, feel free to skip to Introducing the open source Eclipse IDE.
• JSPs
• Servlets
• Custom Java coding
• EJBs
• Model-view-controller (MVC) frameworks
• Lightweight development frameworks
• JCA 1.5 resource adapters connecting to EIS or legacy systems
• Other data-access components
Once a Geronimo
The Application Server code is based on the popular Apache Geronimo project (see
Resources). As such, it comes with the capability to integrate with a large body of
open source technology. Moving forward, Application Server will continue to support
tight integration with best-of-breed open source technology, such as the Apache
Tomcat Web container and the ActiveMQ message broker.
Application Server has built-in support to interoperate with legacy CORBA systems.
You can also use it to deploy and host Web services through its integration with
Apache Axis (see Resources). And you can use Application Server as a
general-purpose Web server to support the serving of static HTML pages and
graphical images.
For high-performance service of static Web assets, you can configure the Apache
JServ Protocol version 1.3 (AJP13) protocol connector to enable Application Server
to accept requests from an industry-standard Apache Web server (front end) (see
The AJP protocol).
Table 3 summarizes the open source server components shown in Figure 11:
The Application Server distribution you download is in Windows EXE format. The file
is probably named wasce_setup-1.0.0.1.exe. (The actual filename might differ
depending on version.)
Make sure you also download the Eclipse plug-in for this version of Application
Server. Note that plug-ins are highly specific to the version of Eclipse and
Application Server that you use. You should not attempt to use the downloaded
plug-in for with any other version of Application Server (or Eclipse) other than the
one specified. In this case, the file is named wasce_eclipse_plugin-1.0.0.1.zip, and it
works against the 3.1.1 version of Eclipse.
To start the server after installation, select IBM WebSphere > Application Server
Community Edition > Start the server from the Windows Start menu.
You should see a command console open that displays the server startup
information, similar to Figure 12:
Figure 12. A system console showing output from the Application Server
startup
To verify the success of the installation, start the Administration Console by selecting
IBM WebSphere > Application Server Community Edition > Administration
Console from the Windows Start menu.
This should start an instance of your browser, pointed to the login page for the
Administration Console. The Administration Console is actually a Web application
running inside Application Server. Figure 13 shows the login screen for the console:
Figure 13. The login screen for the Application Server Administration Console
Instead of using the menu selection, you can always reach the Administration
Console on a browser with the URL http://localhost:8080/console/.
If you wish to explore the Administration Console, use the predefined username
(system) and password (manager).
To start the server, select IBM WebSphere > Application Server Community
Edition > Start the server from the Windows Start menu.
You can also change to the bin directory just below the Application Server
installation directory (or add the bin directory to your PATH environment variable)
and this command:
startup
• Log in to the Administration Console and select Shutdown from its menu
on the left-hand side.
• From the Windows Start menu, select IBM WebSphere > Application
Server Community Edition > Stop the server.
• change directory to the bin directory just below Application Server
installation directory (or add the bin directory to your PATH environment
shutdown
variable) and issue this command:
You can also issue this command from a command line while you're in the bin
subdirectory:
deploy list-modules
Application Server prompts you for a username and password (use system and
manager). This runs the command-line deployer tool and obtains module information
on all the configurations installed on this server. Figure 14 shows the output from a
list-modules command:
In Figure 14, a configuration name preceded by a plus sign (+) indicates that it is
installed and running. A configuration name without the + indicates that it is installed
but not currently running.
Figure 15 shows the list of entries in the repository. You need to upload two new
entries -- one for the JDBC library JAR file and another for the license JAR file.
Figure 15. Uploading the DB2 JDBC driver and license JARs to Application
Server repository
The JDBC library JAR file, called db2jcc.jar, is located in the SQLLIB/java
subdirectory of your DB2 Express-C installation directory. The license file,
db2jcc_license_cu.jar, is also there.
Click the Browse button, browse to the SQLLIB/java directory, and select db2jcc.jar.
Use the settings shown in Figure 15 for adding the db2jcc.jar to the directory. Use
the following settings to add db2jcc_license_cu.jar:
• Group: java
• Artifact: db2jcclicense
• Version: 8.2
• Type: jar
After you add the two JAR files, take a look at the list of entries in the repository and
you should see two new ones:
• java/db2jcc/8.2/jar
• java/db2jcclicense/8.2/jar
Click the Create a new database pool: Using the Geronimo database pool
wizard option.
Fill in the details of the pool with values shown in Table 4. This will involve the next
few screens of the wizard.
Leave the rest of the configuration empty, accepting the default values, and then
click the Test Connection button. This causes Application Server to attempt to
connect to the SAMPLE database. If the attempt is successful, you should see a
screen similar to Figure 17:
The connection is now tested, but to access the data successfully, you must also
add the license JAR file for the JDBC driver to the plan. Unfortunately, there is no
automated way to accomplish this at this time with Application Server. Follow these
manual steps:
Now you can use this plan to deploy the TranQL resource adapter. You can do this
from the command line.
Change the directory to the bin subdirectory of your Application Server installation
and enter this command on one line:
deploy deploy c:\dsplan.xml
e:\wasce10\repository\tranql\rars\tranql-connector-1.1.rar
You need to replace c:\ and e:\wasce10 with the path where you placed the
dsplan.xml file and the location where Application Server is installed, respectively.
The command-line deploy tool prompts you to enter a username and password. Use
system for username and manager for password.
When the TranQL connector is successfully deployed, the deployer tool returns with
the following:
Deployed console-db-pool-dwDatasource
If you select Database Pools again on the Web console menu, the display should
now show the dwDatasource pool as a deployed system-wide database pool.
Applications hosted in Application Server can now access the SAMPLE database by
looking up the console-db-pool-dwDatasource connection pool.
Eclipse has features that are very attractive to developers in general and Java
developers in particular, including:
Figure 18 illustrates the rich features and versatile composition of the Eclipse IDE:
Figure 18. Features of the Eclipse IDE user interface made available to all
plug-ins
familiar with the UI and operations of Eclipse, you will be right at home on any
development platform, including UNIX, Linux, Windows, Mac OSX, and others.
Downloading Eclipse
You can download releases of the Eclipse IDE for your platform from the Eclipse
Project Downloads page.
The Application Server plug-in that you'll use for this tutorial has been tested on
Eclipse 3.1.1. Make sure you download the binary for Eclipse version 3.1.1.
The installation file for Eclipse is distributed in Zip archive format. The name of the
file to download is eclipse-SDK-3.1.1-win32.zip.
If you look into your distribution directory, you will find an eclipse.exe executable,
which starts Eclipse. You might want to drag-and-drop a shortcut onto your desktop
or the system tray to make future launching of the IDE simpler.
Double-click eclipse.exe or run it on the command line. The IDE should start. After
the splash screen, it prompts you to select a workspace, shown in Figure 19:
Figure 19. Selecting the initial workspace for the Eclipse IDE
A workspace is simply a directory where Eclipse manages source code and other
artifacts of your projects. You can maintain as many projects as you wish in a
workspace. In production projects that use version control, development staff often
needs to work on multiple branches of the same source tree at the same time. You
can use multiple workspaces to work on the different branches. For the purpose of
this tutorial, accept the default to let Eclipse create a new workspace for you.
The IDE starts up with a help screen that you can walk through the fundamentals of
working with Eclipse, if you wish. Close Eclipse to prepare for the next step.
You have downloaded the Application Server Eclipse plug-in as part of your
Application Server download. Before you can install the plug-in, you need to
download its prerequisites.
The Application Server Eclipse plug-in requires the Web Tools Platform (WTP)
plug-in for Eclipse. You can download WTP from the Web Tools Platform downloads
page.
You also need to download the EMF driver, GEF driver, and EMF model runtime
driver (called JEM) corresponding to the WTP version that you select. The download
page for the WTP you select includes links to these drivers.
The WTP supports installation through the Eclipse update manager,
which ideally simplifies the download and install process.
Unfortunately, the current setup the of WTP update manager install
does not work reliably.
To install the WTP, EMF, GEF, and EMF model runtimes, unzip the downloaded Zip
files to your Eclipse installation directory. Examine the content of the Zip files before
unzipping them and make sure you match the directory hierarchy.
In the window, select the Database Explorer view, as shown in Figure 20:
A new Database Explorer view appears. Right-click the Connections element and
select New Connection....
Fill in the connection information as shown in Figure 21, pointing to your SAMPLE
database:
Figure 21. Connecting Eclipse to DB2 Express-C through the JDBC driver
In Figure 21, note that you need to enter the user ID and password of the Windows
user under which you set up DB2 Express-C. As you know from Downloading and
installing DB2 Express-C, it should be your own Windows user ID and password.
Another important area is the Class location field (see Figure 21). Click Browse to
locate the SQLLIB/java subdirectory and select the db2cc.jar JDBC driver. You must
manually edit the entry to add the db2cc_license_cu.jar file. Otherwise, the
connection will be denied. In my setup, for example, the entire entry becomes:
C:\Program Files\IBM\SQLLIB\java\db2cc.jar;
C:\Program Files\IBM\SQLLIB\java\db2cc_license_cu.jar
The two entries are separated by a semicolon (;). If you have installed DB2
Express-C somewhere other than the default location, you need to change the path
accordingly.
You should now be able to click Test Connection, and Eclipse should report that
Expand the SAMPLE connection to see your EMPLOYEE and PRODUCTS tables.
Figure 22 shows the expanded EMPLOYEE table:
Figure 22. Exploring the SAMPLE DB2 Express-C database from Eclipse
You can see how easy it is to access information on DB2 Express-C databases from
Eclipse.
Figure 23. Eclipse Data Output view displaying DB2 Express-C table contents
To see the SQL statement that is executed on the DB2 engine, you can click the
Messages tab of the Data Output view.
Eclipse opens up a database edit view. You can see all the data in the table. You
can change the data in the fields, and you can add new rows to the end of the table.
Figure 24 shows this editable view:
This brings up a wizard that guides you through the DDL generation process. Select
all the check boxes in the wizard's first two screens. The wizard's final screen
previews the generated DDL. For the EMPLOYEE table, it is similar to Listing 3:
...
CREATE TABLE "SING"."EMPLOYEE" (
"EMPNO" CHAR(6) NOT NULL,
"FIRSTNME" VARCHAR(12) NOT NULL,
"MIDINIT" CHAR(1) NOT NULL,
"LASTNAME" VARCHAR(15) NOT NULL,
"WORKDEPT" CHAR(3),
"PHONENO" CHAR(4),
"HIREDATE" DATE,
"JOB" CHAR(8),
"EDLEVEL" SMALLINT NOT NULL,
"SEX" CHAR(1),
"BIRTHDATE" DATE,
"SALARY" DECIMAL(10,2),
"BONUS" DECIMAL(10,2),
"COMM" DECIMAL(10,2)
);
...
You can use this DDL to re-create the table on any DB2 database. You can save
this DDL to a file or execute it on a server (perhaps creating the same table in
another database).
The connections and relationships among Eclipse, Application Server, and DB2
Express-C, illustrated in Figure 25, are key to this scenario:
In Figure 25, Eclipse's Database Explorer and Data Output views are used to access
directly the database schema and content managed in DB2 Express-C. Application
Server is configured with a JDBC data pool that accesses DB2 Express-C
databases.
2. Start Eclipse and select File > New > Project... from the application
menu.
Figure 26 shows the directory structure of the dwapp project you've created using
Eclipse's Navigator view:
Figure 26. Creating a new dynamic Web project on the Eclipse IDE
In Figure 26, under the WebContent directory, you can see the standard J2EE WAR
file layout of directories. The wizard has also generated two XML files automatically,
described in Table 5:
Table 5. Wizard-generated XML files for 1.4 J2EE dynamic Web applications
Generated XML file Description
WEB-INF/web.xml Standard J2EE deployment descriptor for Web
applications running on compatible containers.
Must be included with every deployed WAR file.
WEB-INF/geronimo-web.xml Application Server specific deployment plan. This
plan describes server customization for
deployment of this application.
Now you'll create a JSP that accesses the data in the EMPLOYEE table:
1. With the WebContent directory highlighted, right-click and select New >
Other....
4. Click Finish.
Eclipse generates a skeletal JSP page from a template. Edit the page to match
Listing 4. Alternatively, you can copy the source from this tutorial's code download
(see Download).
Listing 4. JSP accessing employee data from the DB2 Express-C SAMPLE
database
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="dwstyles.css"/>
<title>dW Example Employee Data from DB2 Express-C Table</title>
</head>
<body>
<h1> DB2 Express Employee List</h1>
<br>
<table>
<tr>
<th>Emp no</th>
<th>First name</th>
<th>Last name</th>
<th>Phone</th>
<th>Job</th>
<th>Salary</th>
<th>Bonus</th>
<th>Commission</th>
<th>Department</th>
</tr>
<sql:query var="employees" dataSource="jdbc/DataSource">
SELECT * FROM EMPLOYEE
</sql:query>
<c:forEach var="employee" items="${employees.rows}">
<tr>
<td><c:out value="${employee.empno}"/></td>
<td><c:out value="${employee.firstnme}"/></td>
<td><c:out value="${employee.lastname}"/></td>
<td><c:out value="${employee.phoneno}"/></td>
<td><c:out value="${employee.job}"/></td>
<td><c:out value="${employee.salary}"/></td>
<td><c:out value="${employee.bonus}"/></td>
<td><c:out value="${employee.comm}"/></td>
<td><c:out value="${employee.workdept}"/></td>
</tr>
</c:forEach>
</table>
</code>
</body>
</html>
This JSP prints out a table of employee information. Each row displayed represents
one employee record maintained in the DB2 Express-C EMPLOYEE table.
The coding makes use of only JSP Standard Tag Library (JSTL) tags and
Expression Language (EL); it does not contain any embedded Java code.
Embedded Java code in JSP is often viewed as a bad practice because it tends to
become error-prone and unmanageable in the long term.
The boldfaced lines in Listing 4 show how the <sql:query> tag accesses a JDBC
data source called jdbc/DataSource to execute the SQL SELECT statement. The
result of the query is assigned to the employees variable. Each row of this result is
then displayed using a <c:forEach> iterative tag.
This is standard J2EE flexibility. The deployable application WAR file contains
references to resources (such as a data source) that is resolved only when the
application is deployed. This enables the same code module to be deployed, without
reassembly, on different application servers against different database servers.
Examine the web.xml file that is generated and make sure you add the boldfaced
lines from Listing 5. (You might need to click the Source tab of the Eclipse XML file
editor.) Make sure you save the updated web.xml file.
In the geronimo-web.xml, you make the actual link to the dwDatasource. Examine
the geronimo-web.xml deployment plan in Eclipse. (Click the Source tab of the
deployment plan editor.) Add the boldfaced lines shown in Listing 6 to the
deployment plan and save it:
• jstl.jar
• standard.jar
You can download these JAR files from the Jakarta Taglibs page. For your
convenience, they are also included in this tutorial's code distribution under the jstl
subdirectory (see Download).
If your Web project requires static content service, just place the static content
starting from the WebContent directory in your Eclipse project.
Right-click the WebContent directory and select New > Other.... From the pop-up
window, select Web > CSS. You'll add a static Cascading Style Sheet (CSS) to the
application to enhance its appearance. Name the stylesheet dwstyles.css and
accept the default template for the stylesheet.
Edit the dwstyles.css file, adding the content in Listing 7. You can also
copy-and-paste from the code distribution (see Download).
th {
font-family: verdana, arial;
font-size: 13;
font-weight: bold;
align: left;
background-color: black;
color: white;
}
td {
font-family: verdana, arial;
font-size: 12;
font-style: italic;
align: left;
}
table {
border-style: solid;
border-width: thin;
}
Save the modified stylesheet. When you deploy the application, the stylesheet is
accessible directly, as static content, from Application Server. Your user's browser
accesses this static stylesheet to format the dynamic output from index.jsp.
If the first page of your Web project is static and not dynamically generated, you can
simply add an index.html page to the WebContent directory.
You are now ready to deploy the dwapp application to Application Server.
Right-click the dwapp element in Eclipse's Navigator and select Run as > Run on
Server....
In the Run On Server wizard that opens (shown in Figure 27), select Apache
Geronimo v1.0 Server. Make sure you select the check box named Set server as
project default (do not ask again).
Click Next and select the JRE that you are using. (It must be either Sun's JDK
1.4.2_09 or IBM's JDK 1.4.2 SR3; see Prerequisites). Also enter the directory where
you have installed Application Server. This is shown in Figure 28:
Figure 28. Specifying JRE and Application Server runtime for the Eclipse
connected server
Click Finish and wait while Eclipse starts Application Server and deploys the
application to Application Server.
You should see the list of employees displayed on a Web browser window within the
Eclipse IDE, as shown in Figure 29:
The IDE is now connected to Application Server for rapid development and
deployment. At any time during your development cycle, you can deploy your
application to Application Server for testing. If you wish, you can configure the same
Application Server for production. Your application users can then see your
application changes immediately after you deploy the application to the server.
1. Changing the TCP port that the Tomcat (Web connector) listener is
listening to
Log on to the Application Server Administration Console and select Web Server on
the left-hand side menu. You'll see three connectors running, one for regular Web
connections, one for Secure Sockets Layer (SSL)-based connections, and one for
the AJP protocol. This is shown in Figure 30:
Figure 30. Changing the port of the TomcatWebConnector for Internet user
access
Click the edit link next to the HTTP-based TomcatWebConnector. On the next
screen, replace port 8080 with port 80 and click Save.
Now, shut down the server and restart it. Your Application Server application is now
accessible at http://your WWW domain name/your application name.
Next, to get rid of the need to type the name of the application, you'll modify the
application deployment context to map to the root or /.
For example, if you want to move the dwapp application to the root context, you
need to make the change shown in boldface in Listing 8 to its geronimo-web.xml
plan:
The open source Eclipse IDE, the IBM DB2 Express-C database, and IBM
WebSphere Application Server Community Edition are all your disposal, only a short
click away. This collection of servers and IDEs works very well together to make
your design, development, testing, and deployment life simpler.
• Installed and became familiar with DB2 Express-C, using its rich set of
GUI tools and command-line tools
• Created database tables with DB2 Express-C and queried against them
using SQL commands
• Installed and worked with WebSphere Application Server Community
Edition, using its Web-based Administration Console as well as the
command-line deployer tool
• Connected WebSphere Application Server Community Edition to DB2
Express-C by deploying a system-wide database pool to the DB2
database
• Installed the Eclipse IDE, the supporting Web Tools Platform, and the
WebSphere Application Server Community Edition Eclipse plug-in
• Connected Eclipse to DB2 Express-C through Eclipse's versatile
Database Explorer view, which lets you view schema structure, see table
data content, modify data, and generate DDL
• Used Eclipse to create a Web application and deployed it to WebSphere
Application Server Community Edition with one click, supported through
Resources
Learn
• "DB2 Express-C, the developer-friendly alternative" (Grant Hutchison,
developerWorks, February 2006): Get started quickly using DB2 Express-C for
all of your applications.
• Migrate to DB2 Express-C: Resources to help you get started migrating to DB2
Express-C today.
• "Get started with Eclipse: The developerWorks Eclipse resource page.
• "Manage your Eclipse environment" (Chris Aniszczyk and Phil Crosby,
developerWorks,February 2006): Zen and the art of Eclipse maintenance.
• "Migrating to Eclipse": A developer's guide to evaluating Eclipse.
• "Developing Eclipse plug-ins" (David Gallardo, developerWorks, December
2002): Learn to create, debug, and install your plug-ins.
• "Get started with WebSphere Application Server Community Edition" (Nell
Gawor and Lin Sun, developerWorks, December 2005): Learn what you need to
know to get up and running quickly with WebSphere Application Server
Community Edition, from setting up your environment and choosing the right
download package to deploying applications.
• "Migrate from JBoss to WebSphere Application Server Community Edition"
(Shyam Nagarajan, developerWorks, November 2005): An excellent guide for
migrating your applications.
• "Migrate from Apache Tomcat to WebSphere Application Server Community
Edition" (Sing Li, developerWorks, November 2005): Author Sing Li
demonstrates how to migrate a J2EE Web tier application from Apache Tomcat
5.5 to WebSphere Application Server Community Edition V1.0.
• "WebSphere Application Server Community Edition system administration":
Learn everything you need to know to successfully administer a WebSphere
Application Server Community Edition environment.
• WebSphere Application Server Community Edition: Documentation, FAQs,
articles, and more resources.
• Apache Geronimo: The J2EE server from Apache.
• Apache Axis: Apache's reliable and stable base for implementing Java Web
services.
• Apache Tomcat: The Apache servlet container that is used in the official
Reference Implementation for the Java Servlet and JavaServer Pages
technologies.
• Apache Derby: Apache's relational database implemented entirely in Java.
• ActiveMQ: Try out this fast, open source JMS 1.1 provider, which supports