title: Spring Boot version 1.5.9 app does not open view file, not found error 404
body: <p>I have a problem at displaying view file in Spring Boot with version 1.5.9 (the latest version). I created the project from Spring Initializr. I searched everywhere about the probelm in the internet. I tried many different ways but I could not make the view file displayed so I decided to ask here as the last option.</p>
  
  <p>Here is my settings and code:</p>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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;groupId&gt;com.eric&lt;/groupId&gt;
  &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  
  &lt;name&gt;spring-boot-starter&lt;/name&gt;
  &lt;description&gt;Demo project for Spring Boot&lt;/description&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.9.RELEASE&lt;/version&gt;
      &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
  &lt;/parent&gt;
  
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&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-security&lt;/artifactId&gt;
      &lt;/dependency&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;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&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;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>SpringBootStarterApplication.java</strong></p>
  
  <pre><code>package com.eric.springbootstarter;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration;
  import org.springframework.context.annotation.Configuration;
  
  
  
  @SpringBootApplication(exclude = ErrorMvcAutoConfiguration.class)
  public class SpringBootStarterApplication{
  
      public static void main(String[] args) {
          SpringApplication.run(SpringBootStarterApplication.class, args);
      }
  }
  </code></pre>
  
  <p><strong>LoginController.java</strong></p>
  
  <pre><code>package com.eric.springbootstarter;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.servlet.ModelAndView;
  
  @Controller
  public class LoginController {
  
      @RequestMapping(value="/giris", method = RequestMethod.GET)
      public ModelAndView giris(){
          ModelAndView modelAndView = new ModelAndView();
          modelAndView.setViewName("index");
          return modelAndView;
      }
  
  }
  </code></pre>
  
  <p>In the console tab, I get this log:</p>
  
  <pre><code>2017-12-25 18:49:44.874  INFO 8740 --- [           main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
  2017-12-25 18:49:44.892  INFO 8740 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
      name: default
      ...]
  2017-12-25 18:49:44.995  INFO 8740 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.0.12.Final}
  2017-12-25 18:49:44.997  INFO 8740 --- [           main] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
  2017-12-25 18:49:44.998  INFO 8740 --- [           main] org.hibernate.cfg.Environment            : HHH000021: Bytecode provider name : javassist
  2017-12-25 18:49:45.052  INFO 8740 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
  2017-12-25 18:49:45.223  INFO 8740 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
  2017-12-25 18:49:45.625  INFO 8740 --- [           main] org.hibernate.tool.hbm2ddl.SchemaUpdate  : HHH000228: Running hbm2ddl schema update
  2017-12-25 18:49:45.805  INFO 8740 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
  2017-12-25 18:49:46.631  INFO 8740 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.web.context.support.GenericWebApplicationContext@32b260fa: startup date [Mon Dec 25 18:49:41 EET 2017]; root of context hierarchy
  2017-12-25 18:49:46.779  INFO 8740 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/giris],methods=[GET]}" onto public org.springframework.web.servlet.ModelAndView com.eric.springbootstarter.LoginController.giris()
  2017-12-25 18:49:46.834  INFO 8740 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2017-12-25 18:49:46.835  INFO 8740 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2017-12-25 18:49:46.906  INFO 8740 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2017-12-25 18:49:46.954  INFO 8740 --- [           main] oConfiguration$WelcomePageHandlerMapping : Adding welcome page: ServletContext resource [/index.html]
  2017-12-25 18:49:47.514  INFO 8740 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: OrRequestMatcher [requestMatchers=[Ant [pattern='/**']]], []
  2017-12-25 18:49:47.614  INFO 8740 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: org.springframework.boot.autoconfigure.security.SpringBootWebSecurityConfiguration$ApplicationNoWebSecurityConfigurerAdapter$1@41bfa9e9, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@68b7d0ef, org.springframework.security.web.context.SecurityContextPersistenceFilter@59c500f7, org.springframework.security.web.header.HeaderWriterFilter@40ed1802, org.springframework.security.web.csrf.CsrfFilter@2b736fee, org.springframework.security.web.authentication.logout.LogoutFilter@721d5b74, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@50110971, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@73c48264, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@7069f076, org.springframework.security.web.session.SessionManagementFilter@7f42e06e, org.springframework.security.web.access.ExceptionTranslationFilter@1b7f06c7]
  2017-12-25 18:49:48.040  INFO 8740 --- [           main] .y.s.s.SpringBootStarterApplicationTests : Started SpringBootStarterApplicationTests in 6.593 seconds (JVM running for 7.71)
  Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.901 sec - in com.eric.springbootstarter.SpringBootStarterApplicationTests
  2017-12-25 18:49:48.223  INFO 8740 --- [       Thread-3] o.s.w.c.s.GenericWebApplicationContext   : Closing org.springframework.web.context.support.GenericWebApplicationContext@32b260fa: startup date [Mon Dec 25 18:49:41 EET 2017]; root of context hierarchy
  2017-12-25 18:49:48.230  INFO 8740 --- [       Thread-3] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
  </code></pre>
  
  <p><strong>index.html</strong> file is located in src/main/resources/templates folder. I did not put it in a folder like "webapp/WEB-INF/views" because it is old and deprecated. Spring Boot handles all I presume.
  You have any suggestion what else can I do? Thanks in advance.</p>