title: spring boot jsp file can not be viewed
body: <p>I'm using spring boot application. I have set the MvcConfig class for it and added tomcat-embed-jasper and jstl dependencies to pom.xml. However, I can not view my jsp file in the 'WEB-INF' folder, I will get 404 error (Whitelabel Error Page).I have set the Application.properties. here is my application.properties:</p>
  
  <pre class="lang-html prettyprint-override"><code>#
  ## View resolver
  #
  spring.view.prefix: /WEB-INF/jsp/
  spring.view.suffix: .jsp
  </code></pre>
  
  <p>Here is my MvcConfig class:</p>
  
  <pre class="lang-java prettyprint-override"><code>package com.goodvideotutorials.spring.config;
  
  import org.springframework.context.annotation.Configuration;
  import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
  import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
  
  @Configuration
  public class MvcConfig extends WebMvcConfigurerAdapter {
  
      @Override
      public void addViewControllers(ViewControllerRegistry registry) {
          registry.addViewController("/").setViewName("home");
      }
  
  }
  </code></pre>
  
  <p>Here is my home.jsp:</p>
  
  <pre class="lang-jsp prettyprint-override"><code>&lt;%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%&gt;
  &lt;%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;title&gt;Up and running with Spring Framework quickly&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h2&gt;Hello, world!&lt;/h2&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>it is inserted inside src > main > webapp > WEB-INF > jsp > home.jsp</p>
  
  <p>I have added these dependencies to pom.xml: </p>
  
  <pre class="lang-xml prettyprint-override"><code>&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;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
          &lt;/dependency&gt; 
  </code></pre>
  
  <p>this is my Application.java class:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Configuration
  @ComponentScan
  @EnableAutoConfiguration
  public class Application extends SpringBootServletInitializer {
         public static void main(String[] args)  {
             ApplicationContext ctx = SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p>and my controller class:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Controller
  public class RootController {
  
  //  @RequestMapping("/")
  //  public String home() {
  //
  //  return "home";
  //  
  //  }
  
  }
  </code></pre>
  
  <p>Any way if I make the code commented in the controller and don't use MvcConfig, it doesn't work. If I comment that code and use MvcConfig class, it doesn't work as well. This is the url : localhost:8080</p>
  
  <p>I just tested many things , but it shows "Whitelabel Error Page" instead of JSP. I also have Tomcat server installed in the JEE environment. Could that cause problem?</p>