Dynamic Registration and Servlet Container Initializers
Dynamic registration and the servlet container initializer were added to Servlet 3.0. The former is used for installing new web objects (servlets, filters, listeners) without reloading the application. The latter is especially useful for framework developers.
This chapter discusses both features and presents examples.
To make dynamic registration possible, the following methods were added to the ServletContext interface to dynamically create a web object.
<T extends Filter> createFilter(java.lang.Class<T>
<T extends java.util.EventListener> createListener(
<T extends Servlet> createServlet(java.lang.Class<T> ...