Previous: , Up: PB Java Examples   [Contents][Index] Configuring Tomcat for PrologBeans

This section will briefly describe how to set up a Tomcat server so that is it possible to test the example JSPs. Some knowledge about how to run Tomcat and how to set up your own web application is required. Detailed information about Tomcat is available at

Assuming that the environment variable CATALINA_HOME is set to the installation directory of Tomcat, do the following:

  1. Create the directory $CATALINA_HOME/webapps/PB_example
  2. Copy the file pbexamples('sessionsum/sessionsum.jsp') to $CATALINA_HOME/webapps/PB_example/sessionsum.jsp
  3. Create the directory $CATALINA_HOME/webapps/PB_example/WEB-INF/lib
  4. Copy the file $SP_PATH/bin/prologbeans.jar to $CATALINA_HOME/webapps/PB_example/WEB-INF/lib/prologbeans.jar
  5. Create the directory $CATALINA_HOME/webapps/PB_example/META-INF
  6. Create the file $CATALINA_HOME/webapps/PB_example/META-INF/context.xml with the following content:
    <Context docBase="PB_example">
       <Resource name="prolog/PrologSession" auth="Container"
    	     factory="org.apache.naming.factory.BeanFactory" />
  7. Create the file $CATALINA_HOME/webapps/PB_example/WEB-INF/web.xml with the following content:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
         PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
            Object factory for PrologSession instances.
  8. Start SICStus, load and run main.
  9. Start the Tomcat server.
  10. In a web browser, enter http://localhost:8080/PB_example/sessionsum.jsp

Send feedback on this subject.