...
Of the defined EventListener
interfaces in the Servlet API, the javax.servlet.ServletContextListener
events are actually not support. For one thing they do not make much sense in an OSGi environment. On the other hand they are hard to capture and propagate. For example in a bridged environment the contextInitialized
event may be sent before the framework and any of the contained bundles are actually ready to act. Likewise the contextDestroyed
event may come to late.
Servlet Context Notes
ServletContext
instances are managed internally by the Http Service implementation. For each HttpContext
instance used to register one or more servlets and/or resources a corresponding ServletContext
instance is created. These ServletContext
instances is partly based on the single ServletContext
instance received from the Servlet Container — either embedded Jetty or some external Servlet Container when using the Http Service Bridge — and partly based on the provided HttpContext
instance:
Method(s) | Based on ... |
| Servlet Containers |
| |
| |
| |
| Always return |
| Always returns empty |
| By default maintained for each |
Examples
A set of simple examples illustrating the various features are available.
...