Spring Boot - unable to resolve JSP page
<p><strong>application.yml</strong></p>

<pre><code>spring:
    mvc.view:
        prefix: /
        suffix: .jsp
</code></pre>

<p><strong>SampleController.java</strong></p>

<pre class="lang-java prettyprint-override"><code>package springboot_demo;

import javax.annotation.Resource;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import springboot_demo.service.StudentService;

@Controller
@SpringBootApplication
public class SampleController extends SpringBootServletInitializer{

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(SampleController.class);
    }

    @Resource
    private StudentService studentService;


    @RequestMapping("/")
    public String home(Model model) {
        model.addAttribute("data", studentService.list());
        return "index";
    }

    public static void main(String[] args) throws Exception {
        SpringApplication.run(SampleController.class, args);
    }
}
</code></pre>

<p>The 'data' is correctly fetched from database, but the JSP page seems not compiled. I visit <a href="http://localhost:8080" rel="nofollow">http://localhost:8080</a> and the browser shows me like this:</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="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
&lt;html&gt;
&lt;body&gt;
&lt;h2&gt;Hello World!&lt;/h2&gt;
&lt;c:forEach items="${data }" var="i"&gt;
&lt;h2&gt;${i.id }${i.name }&lt;/h2&gt;
&lt;/c:forEach&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>