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.
Create a directory on your local hard drive and call it Excel_WS
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®.
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.
Ensure that you have you have installed the J-Integra® license.
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.
In the Display Name box, type ExcelCalculatorJSP and click Apply.
In the left pane, right-click Web Modules and select New..
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.
The AAT now looks like this:
In the left pane, open Web Modules>ExcelExampleJSP>Files. Right-click Resource Files and select Add Files.
In the Add Files dialog box, click Browse and select Excel_WS as the root directory.
Select ExcelCalculatorExample.jsp and ExcelCalculatorJSP.html and click Add. Then click OK.
In the left pane of the AAT, right-click Web Components and select New.
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.
In the Select file for JSP file dialogue box, select ExcelCalculatorExample.jsp, and click OK.
Click OK twice more to return to the AAT.
In the AAT, click on the File menu and select Save. Select Excel_WS as the directory and ExcelCalculatorJSP.ear as the file name.
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;
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
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
Start the WebSphere Application Server by entering this command:
C:\WebSphere\AppServer\bin\startserver
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
Type in your password and click Submit
Double-click Nodes>your computer name>Application Servers>Default Server>Process Definition.
In the Process Definition window, click Environment.
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.
Click Save on the black menu across the top of the page. In the Save Configuration window, click OK.
Click Exit.
Stop the WebSphere Application Server by entering this command:
C:\WebSphere\AppServer\bin\stopserver
Start the WebSphere Application Server by entering this command:
C:\WebSphere\AppServer\bin\startserver
Open your Web browser and enter this address: http://localhost:9080/webapp/ExcelExampleJSP/ExcelCalculatorJSP.html (Note: The address is case sensitive.)
Enter two numbers and click Submit.
For information on setting up the environment for different platforms, see Setting up the environment to run a JSP and/or Servlet file.