Home / Support / Swiff Chart Generator / Swiff Chart Generator JSP Samples for IBM WebSphere Application Server 4.0
Knowledge Base

SAMPLE: Swiff Chart Generator JSP Samples for IBM WebSphere Application Server 4.0

The information in this article applies to:

  • Swiff Chart Generator 2

Warning: The Swiff Chart Generator JSP samples are exclusively running on Unix Systems


  Download Sources (JSP code and HTML pages) 

  Download IBM WebSphere Archives (EAR and WAR files) 

 

Overview

In this article we walk you through all the steps you must take to run the Swiff Chart Generator JSP samples for IBM WebSphere Application Server V4.0 AES.

Installing and Running the samples from the IBM WebSphere Archives (For Beginners)

Packing, Installing and Running the samples from the JSP files (For Advanced Users)

Uninstalling the samples

How to run Application Assembly Tool (AAT)

Troubleshooting

 

Installing and Running the samples from the IBM WebSphere Archives (For Beginners).

  1. Download and unzip the IBM WebSphere Application archives (Download here). This archive contains the following ready-made archives:

    • Samples.war the Web Module containing the JSP files.
    • SwiffChartJSPSamples.ear the Web Application including the Samples.war Web Module.

  2. Stop WebSphere. To stop WebSphere, execute the stopserver script located in <WebSphere installation directory>/AppServer/bin.
  3. Install SwiffChartJSPSamples.ear 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.
    1. cd <WebSphere installation directory>/AppServer/bin
    2. SEAppInstall.sh -install <path>/SwiffChartJSPSamples.ear -interactive false
    Note: In either case, path is the full pathname of the SwiffChartJSPSamples.ear file. Once the EAR archive is installed on WebSphere Application Server, the JSP files are located in the following directory:
    <WebSphere installation directory>/AppServer/installedApps/SwiffChartJSPSamples.ear/Samples.war

  4. Run the samples. Now that the JSP files are correctly installed on IBM WebSphere Application Server, follow the steps below to run the samples:
    1. Restart WebSphere Application Server. To start and stop WebSphere, execute the startserver and stopserver scripts located in <WebSphere installation directory>/AppServer/bin.
    2. Launch your Web Browser and type the following URL:
      http://<hostname>/swfchart_jsp_samples/index.jsp

 

Packing, Installing and Running the samples from the Java sources (For Advanced Users).

  1. Download and unzip the JSP files (Download here). This archive contains the following directories:

    • the achrive root contains the JSP files and HTML pages.
    • the archive jar/ directory contains the Swiff Chart Generator Java package SwiffChart.jar.

  2. Package the HTML pages and the JSP files 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 SamplesJspWar in the Display Name edit box and press OK.
    7. From the left pane, expand the Files folder.
    8. From the right pane, select the Resource Files folder and press the right button of the mouse.
    9. From the contextual menu, select Add Files.
    10. Press Browse..., navigate the disk and select the directory where the downloaded resources have been unzipped. Press Select.
    11. Select all the HTML pages as well as the all JSP files. Press Add. Press OK. Now the HTML/JSP pages are included in the WAR archive.
    12. From the right pane, select the JAR Files folder and press the right button of the mouse.
    13. Press Browse..., navigate the disk and select the jar/ directory of previously downloaded achive. Press Select.
    14. Select SwiffChart.jar. Press Add. Press OK. Now the SwiffChart.jar file is included in the WAR archive.
    15. From the left pane, select the Context Parameters folder and press the right button of the mouse to display the contextual menu.
    16. From the contextual menu, select New.
    17. In the Parameter name edit box, type SwiffChartInstallDir.
    18. In the Parameter value edit box, type the absolute path of SwiffChart Generator installation directory. Press OK.
    19. Save the .war file. From the File menu, select Save As and enter Samples.war as the file name.

  3. 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 SwiffChartJSPSamples in the Display Name edit box. Press OK.
    7. From the left pane, select the Web Modules folder and press the right button of the mouse to display the contextual menu.
    8. From the contextual menu, select Import to navigate to the Samples.war file previously created. Press Open.
    9. From the resulting dialog box, enter /swfchart_jsp_samples in the Context root edit box.

      Note: The Context root specifies the URL that users should type in order to access the application. In this case, if accessing the SampleBarSWF.jsp directly, the URL is:

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

  4. Stop WebSphere. To stop WebSphere, execute the stopserver script located in <WebSphere installation directory>/AppServer/bin.
  5. Install the EAR file on WebSphere Application Server SwiffChartJSPSamples.ear. 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.
    1. cd <WebSphere installation directory>/AppServer/bin
    2. SEAppInstall.sh -install <path>/SwiffChartJSPSamples.ear -interactive false
    Note: In either case, path is the full pathname of the .ear file. Once the EAR archive is installed on WebSphere Application Server, the JSP files are located in the following directory:
    <WebSphere installation directory>/AppServer/installedApps/SwiffChartJSPSamples.ear/Samples.war

  6. Run the samples. Now that the JSP files are correctly installed on IBM WebSphere Application Server, follow the steps below to run the samples:
    1. Restart WebSphere Application Server. To start and stop WebSphere, execute the startserver and stopserver scripts located in <WebSphere installation directory>/AppServer/bin.
    2. Launch your Web Browser and type the following URL:
      http://<hostname>/swfchart_jsp_samples/index.jsp

 

Uninstalling the samples

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

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

Note: SwiffChartJSPSamples is the application name entered in the Display name text field of the Properties Dialog Box for the SwiffChartJSPSamples.ear file.

 

How to run Application Assembly Tool (AAT)

To run the Application Assembly Tool (AAT) follow the steps below:

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

 

Troubleshooting

If the samples are not running correctly, be sure that Swiff Chart Generator is correctly installed. If Swiff Chart Generator is not installed in its default directory /usr/local/SwiffChart, you must modify the installed JSP files as follow:

  1. cd <WebSphere installation root>/AppServer/installedApps/SwiffChartJSPDemo.ear/SwiffChartJSPDemo.war/
  2. Edit the installed JSP files and replace the following lines:
    String installation_dir= "/usr/local/SwiffChart";
    - by -
    String installation_dir= <Swiff Chart Generator installation directory>;


References:

Keywords:WebSphere samples JSP

Swiff Chart Generator