only allow adding ServletContainerInitializers before starting
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
c6c1ccfdd0
commit
ff4f2ef28f
|
@ -703,6 +703,9 @@ public class ServletContextHandler extends ContextHandler
|
|||
*/
|
||||
public void addServletContainerInitializer(ServletContainerInitializer containerInitializer)
|
||||
{
|
||||
if (!isStopped())
|
||||
throw new IllegalStateException("ServletContainerInitializers should be added before starting");
|
||||
|
||||
addServletContainerInitializer(containerInitializer, Collections.emptySet());
|
||||
}
|
||||
|
||||
|
@ -714,6 +717,9 @@ public class ServletContextHandler extends ContextHandler
|
|||
*/
|
||||
public void addServletContainerInitializer(ServletContainerInitializer containerInitializer, Set<Class<?>> classes)
|
||||
{
|
||||
if (!isStopped())
|
||||
throw new IllegalStateException("ServletContainerInitializers should be added before starting");
|
||||
|
||||
addManaged(new Initializer(this, containerInitializer, classes));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue