I'm working on a modular web application where different bundles contribute
servlets, JSPs, and resources to a single logical application.  While the
bundles are generally independent with respect to the servlet context, there
are a handful of times where they need to share the servlet context.  For
example, integration with third party libraries that expect a single servlet
context for the logical application.

I tried having one bundle create a custom HttpContext and then publishing
that HttpContext for use by other bundles.  The idea being that all UI
bundles would register their servlets, JSPs, and resources with that
HttpContext.  The custom HttpContext would search all bundles that make up
the logical application for resources instead of just searching the bundle
that created the HttpContext.  But I've run in to a few problems:

(1) Only JSPs provided by the first bundle that registered are found.  It
looks like HttpServiceStart#registerJsps only allows a single JSP
registration per HttpContext.  This would be okay given a registration for
*.jsp, but the JasperServlet is initialized with the classloader from the
first bundle to register.

(2) When shutting down a bundle, the HttpContext is removed from the
ServerController (HttpServiceStarted#stop), even if other bundles are still
active and using the same HttpContext.

Is sharing an HttpContext across bundles allowed by the compendium
specification?  I didn't see any specific requirements that prohibit it but
I very easily may have missed something.

Assuming that sharing an HttpContext across bundles is allowed by the
specification, is this something that Pax Web Service and Pax Web JSP will
support in the future?

Thanks,
Michael
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to