/ Home | Support | Swiff Chart Generator | Deploying JSP files to WebSphere Application Server
Knowledge Base

HOW TO: Deploying JSP files to WebSphere Application Server

The information in this article applies to:

  • Swiff Chart Generator 2

In this article we walk you through all the steps you must take to run a Java Server Page (JSP) into WebSphere Application Server V4.0 AES.

Overview

About assembly, configuration and deployement on WebSphere Application Server.

Packaging and installation.

Uninstallation.

How to run Application Assembly Tool (AAT).

 

About assembly, configuration and deployement on WebSphere Application Server

Running a JSP file into WebSphere Application Server V4.0 AES requires that you first create a new J2EE application from your JSP files. J2EE applications are represented by EAR files (i.e. Enterprise Archive files) that can be deployed in a WebSphere application server. EAR files are standard Java archive files with the .ear file extension. They consist of one or more modules (Web modules, EJB modules etc.), each of these modules contains various types of resources (Java resources such as Java Beans, JAR files, classes etc., static resources such as HTML pages, images, and more).

A module containing JSP files is called a Web module. Web modules are represented by WAR files (i.e. Web Archive files). Like EAR files, WAR files are standard Java archive file with the .war file extension. WAR files are used to store one or more Servlets, JSP files, Java classes, HTML pages etc.

WebSphere Application Server V4.0 AES comes with a tool called Application Assembly Tool (AAT) that helps you to create these files (WAR files and EAR files).

 

Packaging and installation

To run JSP files into WebSphere Application Server, you will have to follow the 3 steps below:

  1. Package the JSP files into a WAR file.
  2. Construct an EAR file containing the WAR file.
  3. Install the EAR file on WebSphere Application Server.
  4. Run the JSP application.

1. Package the JSP file into a WAR file.

  1. Start the Application Assembly Tool (AAT). See How to run Application Assembly Tool.
  2. Press Cancel at the Welcome to Application Assembly Tool dialog box.
  3. From the File menu, select New > Web Module.
  4. From the left pane, select the .war file located on top of the tree and press the right button of the mouse to display the contextual menu.
  5. From the contextual menu, select Properties.
  6. From the General tab in the Properties dialog box, type simpleJSP in the Display Name edit box.
  7. Press OK.
  8. From the left pane, expand the Files folder.
  9. From the right pane, select the Resource Files folder and press the right button of the mouse.
  10. From the contextual menu, select Add Files.
  11. Press Browse... and navigate to the directory where the JSP files are located. Press Select.
  12. Select the desired JSP files and press Add.
  13. Once you have selected all the desired JSP files, press OK.
  14. Save the .war file. From the File menu, select Save As and enter simpleJSP.war as the file name.
  15. Close the Application Assembly Tool (AAT) by selecting File > Exit.

2. Construct an EAR file containing the WAR file.

  1. Start the Application Assembly Tool (AAT). See How to run Application Assembly Tool.
  2. Press Cancel at the Welcome to Application Assembly Tool dialog box.
  3. From the File menu, select New > Application.
  4. From the left pane, select the .ear file located on top of the tree and press the right button of the mouse to display the contextual menu.
  5. From the contextual menu, select Properties.
  6. From the General tab in the Properties dialog box, type simpleJSP in the Display Name edit box.
  7. Press OK.
  8. From the left pane, select the Web Modules folder and press the right button of the mouse to display the contextual menu.
  9. From the contextual menu, select Import to navigate to the simpleJSP.war file previously created. Press Open.
  10. From the resulting dialog box, enter /simplejspsample in the Context root edit box.

    Note: The Context root, when combined with the Servlet Mapping defined in the .war file, specifies the URL that users should type in order to access the application. In this case, if accessing the JSP file directly, the URL is:

    http://<hostname>/simplejspsample/<the_jsp_file>.jsp
  11. Press OK.
  12. Save the .ear file. From the File menu, select Save As and enter simpleJSP.ear as the file name.
  13. Close the Application Assembly Tool (AAT) by selecting File > Exit.

3. Install the EAR file on WebSphere Application Server

Use the application installer tool to install the previously created EAR file. The application installer tool is located in the installation directory of WebSphere Application Server.

On Windows Systems:
Run the command line and execute the following steps:

  1. cd <WebSphere installation root>\AppServer\bin
  2. SEAppInstall -install <path>\simpleJSP.ear -interactive false

On Unix Systems:
Run the command line and execute the following steps:

  1. cd <WebSphere installation root>/AppServer/bin
  2. SEAppInstall.sh -install <path>/simpleJSP.ear -interactive false

Note: In either case, path is the full pathname of the .ear file.

Remark: Once the EAR archive is installed on WebSphere Application Server, the JSP files are located in the following directory:

<WebSphere installation root>/AppServer/installedApps/simpleJSP.ear/simpleJSP.war/

4. Run the JSP application

Now that the JSP files are correctly installed on WebSphere Application Server, follow the steps below to run the JSP files:

  1. Restart WebSphere Application Server. To start and stop WebSphere, execute the startserver and stopserver scripts located in <WebSphere installation root>/AppServer/bin.
  2. Launch your Web Browser and type the following URL:
  3. http://<hostname>/simplejspsample/<the_jsp_file>.jsp

Warning: If your JSP files import classes located in external JAR packages, make sure that:
- the Web Application CLASSPATH is correctly set (refers to the directories where these JAR files are located).
- or these external JAR packages are located in the directories specified in the Web Application CLASSPATH.
For more information, see Setting Classpaths in WebSphere Application Server.

 

Uninstallation

Use the application installer tool to uninstall Web Applications. The application installer tool is located in the installation directory of WebSphere Application Server.

On Windows Systems:
Run the command line and execute the following steps:

  1. Stop WebSphere Application Server. To stop WebSphere, execute the stopserver script located in <WebSphere installation root>\AppServer\bin.
  2. cd <WebSphere installation root>\AppServer\bin
  3. SEAppInstall -uninstall simpleJSP

On Unix Systems:
Run the command line and execute the following steps:

  1. cd <WebSphere installation root>/AppServer/bin
  2. SEAppInstall.sh -uninstall simpleJSP

Note: In either cases simpleJSP is the application name entered in the Display name text field of the Properties Dialog Box for the corresponding .ear file.

 

How to run Application Assembly Tool (AAT)

On Windows systems

You can start the AAT either from the command line or from the Windows Start menu.

  1. Click the Windows Start button.
  2. Select Programs > IBM WebSphere > Application Server V4.0 AES > Application Assembly Tool

- or -

  1. Open up a command line session and set the the PATH and CLASSPATH environment variables.
  2. cd <WebSphere installation root>\AppServer\bin
  3. assembly.bat

On Unix systems

  1. cd <WebSphere installation root>/AppServer/bin
  2. assembly.sh

References:

Keywords:JSP WebSphere .ear .war installation

Swiff Chart Generator