Java Servlet Deployment Descriptor Question

Discussion in 'Java' started by Nazario Cipriani, Oct 25, 2006.

  1. Hi guys,

    my question is as follows.
    If I assume the desployment descriptor below (shortened):

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name> XYZ </display-name>
    <description> XZY </description>

    <servlet>
    <servlet-name> servlet </servlet-name>
    <servlet-class>
    soap.SoapServlet
    </servlet-class>
    </servlet>

    <servlet-mapping>
    <servlet-name>servlet</servlet-name>
    <url-pattern>/servlet_1/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>servlet</servlet-name>
    <url-pattern>/servlet_2/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>servlet</servlet-name>
    <url-pattern>/servlet_3/*</url-pattern>
    </servlet-mapping>
    </web-app>

    Now my question: Is the same servlet instance accessed by three
    different URLs or is there for each URL an own servlet instance running
    (are there three instances of the servlet running)?

    Regards,
    Nazario.
    Nazario Cipriani, Oct 25, 2006
    #1
    1. Advertising

  2. Hi,

    AFAIK, there will be only 1 instance of the servlet running in this
    case.

    However, it'd be interesting to know if you put 3 servlet elements all
    pointing to the same <servlet-class> but with different <servlet-name>.
    In that case, I believe it'd be 3 instances.

    -cheers,
    Manish
    Manish Pandit, Oct 25, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Kelm
    Replies:
    1
    Views:
    2,825
    Jeff Kelm
    Sep 11, 2003
  2. circuit_breaker
    Replies:
    2
    Views:
    1,993
    Jack Jia
    Apr 4, 2004
  3. Replies:
    0
    Views:
    354
  4. Replies:
    0
    Views:
    498
  5. Replies:
    0
    Views:
    347
Loading...

Share This Page