Hi, It's possible and permitted. Their url-patterns must be distinct. In Tomcat's implementation, each <servlet> declaration in web.xml corresponds to one instance of the servlet class in the JVM.
Yoav Shapira http://www.yoavshapira.com >-----Original Message----- >From: Dana Cordes [mailto:[EMAIL PROTECTED] >Sent: Wednesday, November 10, 2004 5:37 PM >To: [EMAIL PROTECTED] >Subject: Multiple Servlet Mapping Problem > >Is it possible to have two separate servlets, with separate >configurations pointing to the same class? > >Here's my situation, I have a servlet class that has several >init-parameters. I want to have a second instance of that same servlet >running with different parameters. But it doesn't seem to be working >properly. > >Here's an excerpt from my web.xml: ><servlet> > <servlet-name>MasterControl</servlet-name> > <servlet-class>com.foo.bar.core.MasterControl</servlet-class> > <init-param> > <param-name>CONTROL_PARAMETER_NAME</param-name> > <param-value>command1</param-value> > </init-param> ></servlet> ><servlet> > <servlet-name>MasterControlURA</servlet-name> > <servlet-class>com.foo.bar.core.MasterControl</servlet-class> > <init-param> > <param-name>CONTROL_PARAMETER_NAME</param-name> > <param-value>command2</param-value> > </init-param> ></servlet> ><servlet-mapping> > <servlet-name>MasterControl</servlet-name> > <url-pattern>/aop</url-pattern> ></servlet-mapping> ><servlet-mapping> > <servlet-name>MasterControlURA</servlet-name> > <url-pattern>/ura</url-pattern> ></servlet-mapping> > >What I see is both mapping running, but only displaying the config from >the first servlet definition. Is there something special that I have to >do to get this running correctly? Is it even possible? > >-Dana Cordes > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
