OOP ConfigPerHost API: Flexible configuration for each host header
Apache Tomcat behind the Apache web server (HTTP daemon) can accept the HTTP request for more than one host. And the initialization parameters must be defined for each host header.
Same Servlet for more than one host ...
When connect to Jakarta Apache Tomcat via mod_jk module, Apache web server can redirect the HTTP request to the Servlet on Tomcat.
And the Servlet on Tomcat, that is listening the request at the local host, can accept the HTTP request to multiple hosts.
This feature is useful when you deploy the same web application for multiple hosts, because you can avoid th duplicate installation of the same web application that results in the unnecessary consumption.
Initialization parameters per host by XML
Based on the host header in HTTP request, you may want to set the different values for the same initialization parameter. The XML in this case will look like this:
For some initialization parameters, you may want the same values to be shared among all the hosts. The following fragment shows how to define the initialization parameters for this case.
The initialization parameters can be defined across the multiple XML, i.e. you can prepare as many XML as you like. The series of file names should look like this:
This feature enables you to allocate the single XML for each host.
Initialization parameters in Set and arrays
In addition to String and the typical primitive types, XML can define the Set and arrays of them. For instance, you can get the Set for String by one of the methods listed below:
Or, you can get the int array by one of:
Note that only getXyzValueArray(...) methods are available for the primitive types.
This API is now a part of Bento framework. There are the better documentations and source code examples on the web site for Bento framework. There, you will also find the link to download the entire framework or each API in it.
Java and all Java-based trademarks and logos are trademarks or registered of Sun Microsystems, Inc. in the United States and other countries.
ALL CONTENTS COPYRIGHT 1997-2007, OOP-Research Corporation. All rights reserved.