title: Deploy Spring Boot (with JSP) to Elastic Beanstalk
body: <p>I am attempting to deploy my Spring Boot project to Amazon Elastic Beanstalk.  I have tested and have no issue if I use the default Thymeleaf configuration, but when I switch to JSP based setup I get 404's as it cannot find the JSP's (located in src/main/webapp/WEB-INF/jsp)  </p>
  
  <p>I have attempted to deploy the sample (spring-boot-sample-tomcat-jsp) and find that this as well gives me a 404 when I run the provided test.   </p>
  
  <p>Here is how I have typically been configuring my Spring Boot Projects to allow for the use of JSP's.</p>
  
  <ol>
  <li><p>Add Jasper and JSTL to pom.xml</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
      &lt;artifactId&gt;jstl&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.tomcat.embed&lt;/groupId&gt;
      &lt;artifactId&gt;tomcat-embed-jasper&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre></li>
  <li><p>Override default view resolver configuration</p>
  
  <pre><code>@Configuration
  @EnableWebMvc
  public class MvcConfiguration extends WebMvcConfigurerAdapter
  {
  
      @Bean
      public ViewResolver getViewResolver(){
          InternalResourceViewResolver resolver = new InternalResourceViewResolver();
          resolver.setPrefix("/WEB-INF/jsp/");
          resolver.setSuffix(".jsp");
  
          return resolver;
      }
  
      @Override
      public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer){
          configurer.enable();
      }
  }
  </code></pre></li>
  <li><p>Create folder for JSP's (src/main/webapp/WEB-INF/jsp)</p></li>
  </ol>
  
  <p>Now this method works without issue until I deploy to Elastic Beanstalk where I find that no matter if I create a jar and use Java (in Elastic Beanstalk) or create a war and use Tomcat (in eb) I get a 404 when any controller tries to return a view in the WEB-INF/jsp folder.  </p>
  
  <p>Is the above method for switching to JSP's not recommended?  Is there a better way to configure Spring Boot to use Tomcat/Jasper/JSP's?</p>
  
  <p>I have attempted the method provided in the Spring Boot Samples on github <a href="https://github.com/spring-projects/spring-boot/tree/v1.5.2.RELEASE/spring-boot-samples/spring-boot-sample-tomcat-jsp" rel="noreferrer">here</a></p>
  
  <p><strong>But what's interesting is if I run the provided test i get the same 404.</strong>  </p>
  
  <p>Any help would be greatly appreciated.  If there is a better way to deploy a Spring Boot project that utilizes JSP's I'd be happy to switch  over, but currently I seem to have configured myself into a corner.</p>
  
  <p>Thx!</p>