title: Spring Boot jsp files cannot be found
body: <p>I'm developing simple Spring Boot MVC application. Previously I had everything working with just Spring + Hibernate (that is there was servlet.xml etc.) and I'm trying to rebuild project to use Spring Boot. Althought I have read many answers on SO I still can't fix Spring Boot not finding my .jsp files - it displays whitelabel error page.<br>
  Many answers on SO are about including <code>tomcat-embed-jasper</code> and <code>jstl</code> in <code>pom.xml</code> but I already have it. I'm using IntelliJ IDEA 17 Ultimate, Tomcat 8.5.13, latest versions of Spring and Spring Boot.   </p>
  
  <p>Project structure:<br>
  <a href="https://i.stack.imgur.com/CdNJx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CdNJx.png" alt="enter image description here"></a></p>
  
  <p>Pom.xml:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;artifactId&gt;spring-invoice&lt;/artifactId&gt;
  &lt;groupId&gt;spring-invoice&lt;/groupId&gt;
  &lt;version&gt;1.0.0&lt;/version&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.5.3.RELEASE&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;properties&gt;
      &lt;springframework.version&gt;4.3.8.RELEASE&lt;/springframework.version&gt;
      &lt;hibernate.version&gt;5.2.9.Final&lt;/hibernate.version&gt;
      &lt;mysql.connector.version&gt;5.1.41&lt;/mysql.connector.version&gt;
      &lt;hibernatevalidator.version&gt;5.4.1.Final&lt;/hibernatevalidator.version&gt;
      &lt;start-class&gt;com.invoices.Application&lt;/start-class&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
  
      &lt;!-- Spring boot --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-tomcat&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;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Spring --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;version&gt;${springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
          &lt;version&gt;${springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
          &lt;version&gt;${springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
          &lt;version&gt;${springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
          &lt;version&gt;${springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
          &lt;version&gt;${springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Hibernate --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
          &lt;version&gt;${hibernate.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Hibernate validator --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
          &lt;version&gt;${hibernatevalidator.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- MySQL --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;${mysql.connector.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- C3PO --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.mchange&lt;/groupId&gt;
          &lt;artifactId&gt;c3p0&lt;/artifactId&gt;
          &lt;version&gt;0.9.5.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Servlet + JSP + JSTL --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
          &lt;version&gt;3.1.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
          &lt;artifactId&gt;javax.servlet.jsp-api&lt;/artifactId&gt;
          &lt;version&gt;2.3.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;jstl&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
  
      &lt;finalName&gt;spring-invoice&lt;/finalName&gt;
  
      &lt;plugins&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
  
          &lt;!-- The Compiler Plugin is used to compile the sources of project --&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.6.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
          &lt;!-- Builds a Web Application Archive (WAR) file from the project output and its dependencies. --&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.0.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
      &lt;/plugins&gt;
  
  &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p><code>application.properties</code> file</p>
  
  <pre><code># Database
  spring.datasource.url=jdbc:mysql://localhost:3306/fakturowanie
  spring.datasource.username=root
  spring.datasource.password=1234
  spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect
  
  # Hibernate
  spring.jpa.hibernate.ddl-auto=update
  spring.jpa.show-sql=true
  
  entitymanager.packagesToScan=com.invoices
  spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
  
  spring.mvc.view.prefix=/WEB-INF/view/
  spring.mvc.view.suffix=.jsp
  </code></pre>
  
  <p>Application class</p>
  
  <pre><code>@SpringBootApplication
  public class Application extends SpringBootServletInitializer
  {
      @Override
      protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
      {
          return application.sources(Application.class);
      }
  
      public static void main(String[] args) {
          SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p>One of my jsp files</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;%@ page contentType="text/html;charset=UTF-8" language="java" %&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
  &lt;html lang="pl-PL"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
      &lt;title&gt;Zarządzaj kontrahentami&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;div id="wrapper"&gt;
          &lt;div id="header"&gt;
              &lt;h2&gt;Zarządzaj kontrahentami&lt;/h2&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div&gt;
          &lt;div&gt;
              &lt;!-- put new button: Add Customer --&gt;
              &lt;input type="button" value="Dodaj nowego kontrahenta"
                     onclick="window.location.href='addCustomer'; return false;"
                     class="add-button"/&gt;
  
              &lt;table&gt;
                  &lt;tr&gt;
                      &lt;th&gt;Alias&lt;/th&gt;
                      &lt;th&gt;Nazwisko&lt;/th&gt;
                      &lt;th&gt;Imię&lt;/th&gt;
                      &lt;th&gt;Nazwa firmy&lt;/th&gt;
                      &lt;th&gt;NIP/PESEL&lt;/th&gt;
                      &lt;th&gt;Ulica i nr mieszkania&lt;/th&gt;
                      &lt;th&gt;Kod pocztowy&lt;/th&gt;
                      &lt;th&gt;Miejscowość&lt;/th&gt;
                      &lt;th&gt;Sposób zapłaty&lt;/th&gt;
                      &lt;th&gt;Uwzględnij numer faktury&lt;/th&gt;
                  &lt;/tr&gt;
  
                  &lt;c:forEach var="tempCustomer" items="${allCustomers}"&gt;
  
                      &lt;c:url var="updateLink" value="/customers/updateCustomer"&gt;
                          &lt;c:param name="customerID" value="${tempCustomer.id}"/&gt;
                      &lt;/c:url&gt;
  
                      &lt;c:url var="deleteLink" value="/customers/deleteCustomer"&gt;
                          &lt;c:param name="customerID" value="${tempCustomer.id}"/&gt;
                      &lt;/c:url&gt;
  
                      &lt;tr&gt;
                          &lt;td&gt;${tempCustomer.alias}&lt;/td&gt;
                          &lt;td&gt;${tempCustomer.lastName}&lt;/td&gt;
                          &lt;td&gt;${tempCustomer.firstName}&lt;/td&gt;
                          &lt;td&gt;${tempCustomer.companyName}&lt;/td&gt;
                          &lt;td&gt;${tempCustomer.taxIdentifier}&lt;/td&gt;
                          &lt;td&gt;${tempCustomer.postalCode}&lt;/td&gt;
                          &lt;td&gt;${tempCustomer.city}&lt;/td&gt;
                          &lt;td&gt;${tempCustomer.paymentMethod}&lt;/td&gt;
                          &lt;td&gt;${tempCustomer.includeInCount}&lt;/td&gt;
  
                          &lt;td&gt;
                              &lt;!-- display the update and delete link --&gt;
                              &lt;a href="${updateLink}"&gt;Edytuj&lt;/a&gt;
                              |
                              &lt;a href="${deleteLink}" onclick="if (!(confirm(
                                  'Czy na pewno usunąć tego kontrahenta?'))) return false"&gt;Usuń&lt;/a&gt;
                          &lt;/td&gt;
  
                      &lt;/tr&gt;
  
                  &lt;/c:forEach&gt;
  
              &lt;/table&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And controller of it</p>
  
  <pre><code>@Controller
  @RequestMapping("/customers")
  public class CustomersController implements IUtilities&lt;Customer&gt;
  {
      @Autowired
      private ICustomerDAO customerDAO;
  
      @GetMapping("/manageCustomers")
      public String manageCustomers(Model model)
      {
          List&lt;Customer&gt; allCustomers = convertIterableToCollection(customerDAO.findAll());
          model.addAttribute("allCustomers", allCustomers);
          return "manage-customers";
      }
  
      @GetMapping("/addCustomer")
      public String showFormForAdd(Model model)
      {
          // create model attribute to bind form data
          Customer theCustomer = new Customer();
  
          model.addAttribute("customerToEdit", theCustomer);
  
          return "customer-form";
      }
  
      @GetMapping("/updateCustomer")
      public String showFormForUpdate(@RequestParam("customerID") int customerId, Model model)
      {
          // get the customer from service
          Customer theCustomer = customerDAO.findOne(customerId);
          model.addAttribute("customerToEdit", theCustomer);
  
          //redirect to update form
          return "customer-form";
      }
  
      @GetMapping("/deleteCustomer")
      public String deleteCustomer(@RequestParam("customerID") int customerId)
      {
          //delete the customer
          customerDAO.delete(customerId);
  
          return "redirect:/customers/manageCustomers";
      }
  
      @PostMapping("/saveCustomer")
      public String saveCustomer(@ModelAttribute("customerToEdit") Customer customer) {
          //save the customer using our service
          customerDAO.save(customer);
  
          return "redirect:/customers/manageCustomers";
      }
  
      @Override
      public List&lt;Customer&gt; convertIterableToCollection(Iterable&lt;Customer&gt; iterable) {
          List&lt;Customer&gt; list = new ArrayList&lt;&gt;();
          iterable.forEach(list::add);
          return list;
      }
  }
  </code></pre>