Shipping Advisor JSP Sample

This example adopts shipping advisor to Java Server Pages. The source code is in:

Building the Sample

To build the sample:

  1. Build ship.xpl by compiling and linking ship.pro.
  2. Change the pathname in shipPageBean.java for the call to ls.Load to match your webserver (see below).
  3. Build shipPageBean.class by compiling shipPageBean.java with javac
  4. Organize the files into the proper directories for your JSP/web server software. You will also need to put amzi.dll and amzijni.dll (Windows) or libamzi.so and libamzijni.so (Unix) where the JSP/web server can find it.

Running the Sample

Tomcat

Tomcat generally installs in a directory named Apache Group/Tomcat X.X.

In order to run this servlet under Tomcat (where X.X is replaced by the version of Tomcat you are running, and N.N by the version of Java you are running):

  1. Create a sudirectory in ...Apache Group/Tomcat X.X/webapps named 'ship'.
  2. Copy the amzi/samples/internet/jsp/ship/WEB-INF subdirectory tree to ...Tomcat X.X/webapps/ship.
  3. Create a directory named 'classes/ship' under the 'WEB-APPS' subdirectory resulting in ...Tomcat X.X/webapps/ship/WEB-INF/classes/ship.
  4. Copy shipPageBean.class to ...Tomcat X.X/webapps/ship/WEB-INF/classes/ship.
  5. Copy ship.xpl to ...Tomcat X.X/webapps/ship (this pathname should match the one you edited into shipPageBean.java under 'Building the Sample').
  6. Copy amzi.dll, amzijni.dll (from amzi/bin) to ...Tomcat X.X/webapps/ship/WEB-INF/classes. Alternatively, you can load these libraries (and LSXs) explicitly in Java with Runtime.getRuntime().load(libraryPath) or loadLibrary(libraryName).
  7. Copy the entire amzi/ls subdirectory tree (from amzi/lsapis/java20) to ...Tomcat X.X/webapps/ship/WEB-INF/classes (so you now have the Logic Server .class files in Tomcat X.X/webapps/ship/WEB-INF/classes/amzi/ls).
  8. Stop and restart Tomcat.
  9. In your browser type, http://localhost:8080/ship/shipPage.jsp. Fill in the prompts and press the button.