Java Reference
In-Depth Information
Appendix C
Installing a Java Application on WAS
In this appendix, you will learn what a JEE application server is and how to move a server-based application from RAD
onto a WebSphere Application Server (WAS) using the WAS Administrative Console. In addition, you will learn about
EARs (Enterprise Archive files) and WARs (Web Archive files) and how to export EARs and WARs using RAD. This
appendix assumes that you have completed at least the JSP chapter but will demonstrate how to install and access the
server-based applications created in Chapter 9.
Application Servers
What makes a computer an application server? The computer must have a communication line linked to a network,
a network address, and, most importantly, be running application server software. Oracle dictates a set of rules called
JEE (Java Enterprise Edition) that define how the Java application server must work. There are a variety of vendors
who supply application server software, but all “JEE application servers” must follow Oracle's rules. (IBM's WebSphere
Application Server (WAS) was one of the first certified JEE servers.)
For example, the JEE rules dictate where all the server-based application components are stored on the server.
In other words, specific directories hold the various server-based application pieces (Web pages, Java classes, JSPs,
etc.). Therefore, to publish a Web page or application to the Web, you need access to a computer that is acting as an
application or Web server, and you need to know where to put the files. In the earlier days of server-side programming,
the programmer had to move the files into the correct directories on the server. Fortunately, JEE also defines
specialized files, EARs and WARs, to store all the application components in the correct directory structure.
Many years ago, Sun Microsystems defined the specifications for JARs (Java Archive Files). JARs are Zip files with
a specific folder structure to hold multiple Java classes. JAR files are a very easy way to move and store many Java
classes at once (just as Zip files are an easy way to move and store multiple PC files).
WARs and EARs are JAR files with extra information about the server-side application (i.e., a list of the class
files and Web pages, security information, where the files are stored, etc.). Both WARs and EARs hold server-based
applications, but EARs support very complex applications (e.g., applications that are installed across many servers,
have client-based components, use application-wide database connections, etc.) In other words, EARs are more
complicated than WARs. Fortunately, you don't have to worry about the internal structure of either of these files
(and be happy you don't), because RAD creates EARs and WARs for you.
Tutorial: Exporting
Just as you must first export the PC-based application class files before installing them, the server-based components
must be exported. As you may have noticed, the number of individual files in a server-based application can be quite
large. Fortunately, RAD lets you export an entire project at once and if the project is exported as an EAR or WAR, RAD
will maintain the correct directory structure.
 
Search WWH ::




Custom Search