tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evan Yang <e...@netsco.com>
Subject question regarding to severlet definition in web.xml
Date Wed, 05 Jul 2000 21:56:06 GMT
Hi,

I just subscribed to this mailing list, so excuse me if my question is
old.
I have a frame work for using servlet in kind of MVC pattern.
The servlet controller class is a dummy class derived from HttpServlet,
all it does is direct the actions form html to the model object using
java reflection,
then after the model has done with it's process, the data is send to
view object for displaying.
The model and view objects are constructed dynamically when controller
(a servlet) is instantiated.
The class of model and view are defined in a property file.
In this design the controller never changed.

But then the problem with the Tomcat configuration in web.xml:

   <servlet>
      <servlet-name>testSession</servlet-name>
      <servlet-class>com.netsco.util.servlet.ServletBase</servlet-class>

      <init-param>
            <param-name>PropertyFile</param-name>

<param-value>/web/docroot/WEB-INF/conf/testSession.properties</param-value>

      </init-param>
   </servlet>
   <servlet>
      <servlet-name>testSession2</servlet-name>
      <servlet-class>com.netsco.util.servlet.ServletBase</servlet-class>

      <init-param>
            <param-name>PropertyFile</param-name>

<param-value>/web/docroot/WEB-INF/conf/testSession2.properties</param-value>

      </init-param>
   </servlet>

If the first testSession servlet is instantiated, then the second
testSession2 will never be created.
May be due to they are the same class ?

But in my design they should be different instances using different
model and view to handle different events.
Is there a way the Tomcat can construct new servlet even if they defined
as the same class ?
Thanks for any response in advance.

Evan





Mime
View raw message