Hi,

Am Montag, den 13.08.2007, 14:09 +0800 schrieb Niclas Hedhman:
> On Monday 13 August 2007 11:24, David Leangen wrote:
> > The spec mentions that, understandably, two different servlets cannot be
> > registered under the same alias. However, I see no mention either way of
> > registering the same servlet under two different aliases. I don't see
> > why this should be illegal...
> 
> The spec mentions that ServletException should be thrown if the Servlet has 
> been registered under a different alias. See 102.11.3.3 in Release 4.0.1
> 
> I suspect that there are problems in the servlet spec, since one can ask for 
> the ServletContext for the base URL, which would then need to be generated 
> per request (whether needed or not), or something like that. I'd be happy to 
> hear about the background for this part of the spec, if anyone remembers...

Well, in section 102.2, Registering Servlets, the spec says, that
HttpService has to call the Serlvet.init method, when the servlet is
registered. And concludes that "therefore, the same Servlet instance
must not be reused for registration with another Http Service, nor can
it be registered under multiple names. Unique instances are required for
each registration."

> The obvious work-around would be a servlet delegator.

I fear, that the servlet delegator would have to take care to not call
init multiple times on the delegate. Likewise the destroy method
delegation must be handled with care.

Regards
Felix

_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev

Reply via email to