Node:PB Ex Tomcat, Previous:PB Ex Servers, Up:PB Java Examples
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 http://jakarta.apache.org/tomcat/.
The example described below has been tested with Tomcat 5.5.4.
Assuming that the environment variable CATALINA_HOME is set to the installation directory of Tomcat, do the following:
$CATALINA_HOME/webapps/PB_example
pbexamples('sessionsum/sessionsum.jsp')
to $CATALINA_HOME/webapps/PB_example/sessionsum.jsp
$CATALINA_HOME/webapps/PB_example/WEB-INF/lib
$SP_PATH/bin/prologbeans.jar
to $CATALINA_HOME/webapps/PB_example/WEB-INF/lib/prologbeans.jar
$CATALINA_HOME/webapps/PB_example/META-INF
$CATALINA_HOME/webapps/PB_example/META-INF/context.xml
with the following content:
<Context docBase="PB_example"> <Resource name="prolog/PrologSession" auth="Container" type="se.sics.prologbeans.PrologSession" factory="org.apache.naming.factory.BeanFactory" /> </Context>
$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" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <resource-env-ref> <description> Object factory for PrologSession instances. </description> <resource-env-ref-name> prolog/PrologSession </resource-env-ref-name> <resource-env-ref-type> se.sics.prologbeans.PrologSession </resource-env-ref-type> </resource-env-ref> </web-app>
sessionsum.pl
and run main.