Hi,
> I know I can treat the servlets as a separate webapp and deploy them to
> each separate host, but if I do this, will they be able to access the
> different configuration ( <context-param> and JNDI resources )
> specified in the each ROOT context's web.xml? 

What about having the same servlet referenced more than once in the same 
web.xml with different init-params ? Consider you have Servlet 
com.codemagi.FooServlet, then you could do
------------
  <servlet>
    <servlet-name>
       com.gargelmarf.FooServlet
    </servlet-name>
    <servlet-class>
        com.codemagi.FooServlet
    </servlet-class>
    <init-param>
       <param-name>brandType</param-name>
       <param-value>1</param-value>
    </init-param>
    {...}
  </servlet>

  <servlet>
    <servlet-name>
       com.foobaz.FooServlet
    </servlet-name>
    <servlet-class>
        com.codemagi.FooServlet
    </servlet-class>
    <init-param>
       <param-name>brandType</param-name>
       <param-value>2</param-value>
    </init-param>
    {...}
  </servlet>
----------
All these servlets can be accessed from the same context, but
have different names. The servlet com.codemagi.FooServlet reads the
init-param to determine the brand.
If you access:
  /mycontext/servlet/com.gargelmarf.FooServlet
  /mycontext/servlet/com.foobaz.FooServlet
all that is called are two different instances of com.codemagi.FooServlet,
sharing the same context but with different init-params.

Probably this is the easiest way to do it.

ciao,
 -hen


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to