I'm seeing a behaviour that suggests instantiation of servlets
due to an invocation via a "servlet-mapping" or via the
InvokerServlet (/servlet) are handled differently.
More specifically, given that I've set up a Context for
the path "/foo", and within that context, I've mapped
"/some" to SomeServlet.
If I make a request to http://localhost/foo/some, I can
see the creation of an instantiation of SomeServlet.
But, if I also make the request to
http://localhost/foo/servlet/SomeServlet, I see an additional
creation of an instance of SomeServlet.
Is this an intentional behaviour or a bug?
(Note: I have servlet reloading enabled)
According to Servlet 2.2 Spec:
> 3.2 Number of Instances
> By default, there must be only one instance of a servlet
> class per servlet definition in a container.
> ...
> 3.3.1 Loading and Instantiation
> ...
> It is important to note that there can be more than one
> instance of a given Servlet class in the servlet
> container. For example, this can occur where there
> was more than one servlet definition that utilized a
> specific servlet class with different initialization parameters.
> ...
Does the above two usage scenarios constitute a
different "servlet definition"?
Thanks,
Rob.