Deploying a JSP to WebSphere Application Server V4.0 AES

In this document we walk you through all the steps you must take to deploy the sample JSP into WebSphere Application Server V4.0 AES.

The steps involved

  1. Preparation

  2. Deploy the example

  3. Authentication

  4. Run the example
  5. Setting Up the Environment

Preparation

  1. Create a directory on your local hard drive and call it Excel_WS

  2. Copy ExcelCalculatorExample.jsp and ExcelCalculatorJSP.html files in this directory These files are included in your jintegra\examples\servlet-com\ServletToExcelCalculator directory when you download J-Integra®.

Deploy the example

This section explains how you can run the ExcelCalculatorExample in WebSphere Application Server V4.0 AES. We are going to share the JAR files used by this JSP. So the only things that we need to create for the deployment are the JSP file and the html file. In order to deploy the JSP onto the WebSphere Application Server V4.0 AES, we must have an EAR file that contains the WAR file for the JSP and the XML files mandated by the J2EE specification. WebSphere Application Server V4.0 AES comes with a tool called Application Assembly Tool (AAT) that helps you to create these files.

  1. Ensure that you have you have installed the J-Integra® license.

  2. You can start the AAT either from a DOS prompt or from the Windows Start menu. To run AAT from a DOS prompt, open up a DOS session and set the the PATH and CLASSPATH environment variables. Then go to the bin directory under the directory in which you have installed WebSphere, and enter this command:
    assembly.bat

    -or-

    Click the Start button and then click Programs>IBM WebSphere>Application Server V4.0 AES>Application Assembly Tool

    The Welcome to Application Assembly Tool dialog box opens.

    Select Application and click OK.

    The AAT creates an empty application for you.

  3. In the Display Name box, type ExcelCalculatorJSP and click Apply.

  4. In the left pane, right-click Web Modules and select New..

  5. In the New Web Module dialogue box, enter ExcelExampleJSP.war as the File name, enter /webapp/ExcelExampleJSP as the Context root, and ExcelExampleJSP as the Display Name. Click OK to add the new WAR file.

  6.  The AAT now looks like this:

  7. In the left pane, open Web Modules>ExcelExampleJSP>Files. Right-click Resource Files and select Add Files.

  8. In the Add Files dialog box, click Browse and select Excel_WS as the root directory.

  9. Select ExcelCalculatorExample.jsp and ExcelCalculatorJSP.html and click Add. Then click OK.

  10. In the left pane of the AAT, right-click Web Components and select New.

  11. In the New Web Component dialogue box, enter ExcelCalculatorJSP in the Component Name box. Enter Excel Calculator JSP in the Display Name box. Select JSP as the Component Type. Click Browse.

  12. In the Select file for JSP file dialogue box, select ExcelCalculatorExample.jsp, and click OK.

  13. Click OK twice more to return to the AAT.

  14. In the AAT, click on the File menu and select Save. Select Excel_WS as the directory and ExcelCalculatorJSP.ear as the file name.

  15. JSP files are text files. The Servlet Container converts them to Java Servlet files and then compiles them as Java class files. One of the options available on the WebSphere Application Server is pre-compiling the JSP file. Our JSP file needs some class files that reside in jintegra.jar and excel.jar. In order for the WebSphere pre-compiler to access these files, we must set the classpath correctly. You can set the classpath in one of the batch files that WAS uses to initialize the environment variables. It is called setupCmdLine.bat and it is located in the bin directory. Open this file and add the path to your jar files at the end of WAS_CLASSPATH line. For example if you want to set the classpath for the JSP example, then this line will look like this: (Let assume your jintegra.jar, and excel.jar are in D:\JLib)

    SET WAS_CLASSPATH=%WAS_HOME%\properties;%WAS_HOME%\lib\bootstrap.jar;
    SET WAS_CLASSPATH=%WAS_CLASSPATH%;D:\JLib\jintegra.jar;D:\JLib\excel.jar;

  16. Now you have the EAR file that contains the WAR file and all other XML files that you need to deploy the JSP. Go to the bin directory of WebSphere and enter this command (all in one line): (We assume your ear file is in D:\Excel_WS\ExcelCalculatorJSP.ear) :
    C:\WebSphere\AppServer\bin\seappinstall
    -install D:\Excel_WS\ExcelCalculatorJSP.ear -interactive false
    -configFile c:\WebSphere\AppServer\config\server-cfg.xml

  17. Now you should have the JSP installed on the server. If the WebSphere Application Server is running, stop it by entering this command:
    C:\WebSphere\AppServer\bin\stopserver

Authentication

  1. Start the WebSphere Application Server by entering this command:
    C:\WebSphere\AppServer\bin\startserver

  2. The JSP needs authentication in order to have access to COM objects. J-Integra® is capable of performing the authentication on behalf of the JSP. There is a native DLL file that does the job, however the path to this DLL must be in your PATH environment variable. To set the path, you need to use the Administrators Console.Open the Start menu and then click Programs>IBM WebSphere>Application Server V4.0 AES>Administrators Console

  3. Type in your password and click Submit

  4. Double-click Nodes>your computer name>Application Servers>Default Server>Process Definition.

  5. In the Process Definition window, click Environment.

  6. In the System Properties window, click New. Enter PATH as the Name. Specify the path to jintegra\bin as the Value. For example, if you have installed J-Integra® in D:\jintegra, you must enter D:\jintegra\bin as the Value. Click OK.

  7. Click Save on the black menu across the top of the page. In the Save Configuration window, click OK.

  8. Click Exit.

  9. Stop the WebSphere Application Server by entering this command:
    C:\WebSphere\AppServer\bin\stopserver

Run the example

  1. Start the WebSphere Application Server by entering this command:
    C:\WebSphere\AppServer\bin\startserver

  2. Open your Web browser and enter this address: http://localhost:9080/webapp/ExcelExampleJSP/ExcelCalculatorJSP.html (Note: The address is case sensitive.)

  3. Enter two numbers and click Submit.

Setting Up the Environment

For information on setting up the environment for different platforms, see Setting up the environment to run a JSP and/or Servlet file.