OOP-ResearchMake It Simpler by Object Oriented Programming

OOP ServletWorker API: Flexible deployment for each host header

Apache Tomcat behind the Apache web server (HTTP daemon) can accept the HTTP request for more than one host. With this Java API, Servlet can take the advantage of this feature.
The HTTP request to Apache web server can be redirected to Jakarta Tomcat, and the same Servlet object can accept the HTTP request for more than one host. This feature can prevent the unnecessary resource consumption, but the same response for every host is not enough. By the help of this API, Servlet can process the HTTP request in the different way for each host.

Putting it all togather : OOP Bento framework

This Java API is now a part of OOP Bento framework. In this MVC framework by XML, you can write all the GUIs in the web application in the normal HTML, XHTML, WML, HDML or any other mark-up languages. And you no longer need to bother about the user authentication and the session tracking. Because its full working source code example will be the good starting point of this Java API, please also visit the web site of Bento framework.

Related Pages:


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.
The configuration file (server.xml) for Tomcat 4 will look like this:



    <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
               port="8009"
               address="127.0.0.1"
               minProcessors="5"
               maxProcessors="75"
               acceptCount="10"
               debug="0"/>

    <Engine name="Standalone" defaultHost="localhost" debug="0">

      <Host name="localhost" debug="0"
       appBase="/home/foo/webapps/example01"
       autoDeploy="false">


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.

Go Site Map

Different response for each host ...

By the above configauration, each Servlet behaves in a same way for the response to the HTTP request with the same path, regardless the host header. In other words, the host header in the HTTP request does not affect the behavior of the Servlet. But, only for the specific request path, there may be the case that your Servlet must send back the different response for each host. To make it possible, you must implement the Servlet that depends on the host header, and deploy this Servlet for that specific request path. If the deployment mechanisum allows you to deploy the different Servlet for each host, the things will be much easier. And voilà, OOP ServletWorker
Instead of Servlet, this API defines

  • ServletWorker

Please implements this interface for each request path. The relationship between the request path and the class name of the implementation should be written into the XML. And this XML allow you to define the relationship for each host.

Go Site Map

Download

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.

Caution!
All the APIs for Servlet/JSP introduced by this web site are now included in Bento framework:
  • Simpler than JSTL or Apache Struts
  • MVC framework by HTML
  • Input validation from CGI FORM
  • Easy user authentication
  • Easy localization (L10n)
To download the APIs and source code examples, please visit the web site of Bento framework.


JBuilder 2007


General Information

For Java Development

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.