title: IllegalStateException after upgrading web app to Spring Boot 2.4
body: <p>My web app is no longer starting after upgrading to Spring Boot 2.4.  It is throwing the following error :</p>
  <pre><code>Unable to locate the default servlet for serving static content. Please set the 'defaultServletName' property explicitly.
  </code></pre>
  <p>I am using the following code to change the context path and my research points me to that being the &quot;culprit&quot; (changing context path) :</p>
  <pre><code>@Bean
  public ServletWebServerFactory servletContainer() 
  {
      String tomcatPort = environment.getProperty(&quot;tomcatPort&quot;);
      
      TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
      tomcat.setPort(tomcatPort != null ? Integer.parseInt(tomcatPort) : 8080);
      tomcat.setContextPath(&quot;/Carbon&quot;);
      tomcat.setBaseDirectory(new File(System.getenv(&quot;MDHIS3_HOME&quot;)));
      
      setTomcatProtocol(tomcat);
      
      return tomcat;
  }
  </code></pre>
  <p>I have the following method and I can see that it can be used to pass a defaultServletName but I have no idea what value I'm supposed to pass :</p>
  <pre><code>@Override
  public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) 
  {
      configurer.enable();
  }
  </code></pre>
  <p>This worked perfectly on Spring Boot 2.3.4.  What value do I pass in there?  Is it the name of the main controller?</p>