If a war file is deployed to Tomcat, Jetty, or Undertow, we currently configure and customise the servlet web server factory even though it will never be used. It would be useful to be able to make the configuration and customization conditional on the app not being deployed to an external container.
Comment From: spencergibb
Spring Cloud has a similar requirement to do something different in a war.
Comment From: philwebb
Adding a note here in case we need to return to this issue in the future.
The code below currently works because we set the ServletContext
quite late in the embedded case. With a war deployment, it's set very early.
ServletContext servletContext = applicationContext.getServletContext();
if (servletContext != null) {
return ConditionOutcome.match("Application is deployed as a WAR file.");
}