You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Evan Yang <ev...@netsco.com> on 2000/07/05 23:56:06 UTC

question regarding to severlet definition in web.xml

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





Re: question regarding to severlet definition in web.xml

Posted by Evan Yang <ev...@netsco.com>.
I found out my problem, nothing to do with Tomcat.
Just let you kown in case there are people actually reading this mail.

Evan

Evan Yang wrote:

> 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
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org