Java Servlet Deployment Descriptor Question

N

Nazario Cipriani

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.
 
M

Manish Pandit

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top