To use this module, place the library file in the "modules" directory in the Apache hierarchy. Then configure the httpd.conf configuration file as follows.
Add a LoadModule command:
LoadModule jaxcent_module modules/mod_jaxcent20.dll
Add a Location command:
<Location /servlet/JaxcentServlet20> SetHandler jaxcent-handler </Location>
Specify the Jaxcent initialization parameters in an IfModule block, as shown.
<IfModule jaxcent_module> Parameters... </IfModule jaxcent_module>
Each parameter line consists of a parameter key name, followed by a space and the value of the parameter. The following are the parameter names.
JVM | Full path to the Java JVM.DLL on your system. This should be somewhere under your Java installation "bin" directory. This parameter is required. |
Classpath | Classpath to use when starting up Java via the JVM DLL. The path must
contain the following three files:
This parameter is required. |
LogFile | Full path to a log file where output from your Java classes will go.
Any output you send to "System.out" as well as any exception stack traces
will appear here.
This parameter is required. |
JaxcentConfigXML | Path to a config XML file, which will contain the path mappings for Jaxcent. Similar to the servlet mappings, Jaxcent maps URLs to Java classes that it then loads, to process those URLs. This parameter is required. |
ReloadableClasses | Classpath for Jaxcent. The classes you write for Jaxcent, will be loaded from this classpath. You can also provide these classes to the application server, but during development it is recommended that you give the classes to Jaxcent directly. Jaxcent will reload these classes whenever they change. If you reload them using the application server, the context may get reloaded, which will break any existing Jaxcent connections. If Jaxcent does the reloading, existing web pages will continue using the old code, but when the page gets loaded again or refreshed, the new code will be used. This paramter is not required, but is recommended. |
Parameter | You can provide other parameters for use by your own application, using the key Parameter followed by a line containing the key of your parameter, an equal sign, and the value of your parameter. These will simply be passed on to your application. |
A sample portion of httpd.conf file is shown below.
LoadModule jaxcent_module modules/mod_jaxcent20.dll <Location /servlet/JaxcentServlet20> SetHandler jaxcent-handler </Location> <IfModule jaxcent_module> JVM C:\j2sdk1.4.2_13\jre\bin\client\jvm.dll classpath C:\Jaxcent\JaxcentFramework20.jar;C:\Jaxcent\JaxcentConnector20.jar;C:\Jaxcent\jaxcent20.jar;C:\MyPermClasses JaxcentConfigXML C:\Jaxcent\samples\JaxcentSampleConfig.xml LogFile C:\Jaxcent\ApacheLog.txt ReloadableClasses C:\Jaxcent\samples;c:\Jaxcent\MyClasses Parameter MyParameter=MyValue Parameter MyNumber=23 </IfModule>
When the module has been correctly configured, visit the URL http://localhost//servlet/JaxcentServlet20 (changing the domain as appropriate) in a browser, to make sure the module is working as expected.
You will also need to copy the file jaxcent20.js to the Apache root path (usually "htdocs").