|
|
@ -540,6 +540,21 @@ class TomcatServletWebServerFactoryTests extends AbstractServletWebServerFactory
|
|
|
|
() -> factory.getWebServer((context) -> context.addListener(new FailingServletContextListener())));
|
|
|
|
() -> factory.getWebServer((context) -> context.addListener(new FailingServletContextListener())));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void registerJspServletWithDefaultLoadOnStartup() {
|
|
|
|
|
|
|
|
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0);
|
|
|
|
|
|
|
|
factory.addInitializers(new ServletContextInitializer() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onStartup(ServletContext servletContext) throws ServletException {
|
|
|
|
|
|
|
|
servletContext.addServlet("manually-registered-jsp-servlet", JspServlet.class);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.webServer = factory.getWebServer();
|
|
|
|
|
|
|
|
this.webServer.start();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected JspServlet getJspServlet() throws ServletException {
|
|
|
|
protected JspServlet getJspServlet() throws ServletException {
|
|
|
|
Tomcat tomcat = ((TomcatWebServer) this.webServer).getTomcat();
|
|
|
|
Tomcat tomcat = ((TomcatWebServer) this.webServer).getTomcat();
|
|
|
|