title: Spring Boot 4 Not Rendering JSPs throwing 404
body: <p>I have the following project structure</p>
  
  <pre><code>-src
    -main
      -java
        -com
          -test
            Application.java
            -controllers
              MyController.java
      -webapp
        -WEB-INF
          -jsp
            main.jsp
  </code></pre>
  
  <p>I want to do something similar to <a href="https://github.com/spring-projects/spring-boot/blob/master/spring-boot-samples/spring-boot-sample-web-jsp" rel="nofollow">this</a> but I have the following in my controller</p>
  
  <pre><code>@Controller
  @RequestMapping("/my/**")
  public class MyController {
      @RequestMapping("/home")
      public String loadHomePage(Model m) {
          m.addAttribute("name", "CodeTutr");
          System.out.println("Test the view controller");
          return "main";
      }
  }
  </code></pre>
  
  <p>and when I go to <code>http://localhost:8080/my/home</code> I get the log message and a 404. I thought in spring 4 I did not need the view resolver but if I do, how do I configure it.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I created a application.properties with the following...</p>
  
  <pre><code>spring.view.prefix: /WEB-INF/jsp/
  spring.view.suffix: .jsp
  application.message: Hello Phil
  </code></pre>
  
  <p>But it is still not working.</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>The provided Spring sample also seems to fail in the same way with the following build.gradle....</p>
  
  <pre><code>buildscript {
    repositories {
      mavenLocal()
      mavenCentral()
      maven { url "http://repo.spring.io/snapshot" }
      maven { url "http://repo.spring.io/milestone" }
    }
    dependencies {
      classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.4.BUILD-SNAPSHOT")
    }
  }
  apply plugin: 'war'
  apply plugin: 'spring-boot'
  apply plugin: 'groovy'
  war { baseName='itext' }
  repositories {
    mavenLocal()
    mavenCentral()
    maven { url "http://repo.spring.io/snapshot" }
    maven { url "http://repo.spring.io/milestone" }
    maven { url "http://repo.spring.io/libs-release" }
  }
  dependencies {
    compile("org.springframework.boot:spring-boot-starter-web")
    compile("org.springframework.boot:spring-boot-starter-websocket")
    compile("org.springframework:spring-messaging")
    providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
    testCompile("org.springframework.boot:spring-boot-starter-test")
    compile 'org.codehaus.groovy:groovy-all:2.2.0'
    compile 'com.lowagie:itext:4.2.1'
    compile 'com.google.code.gson:gson:2.2.4'
  }
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>I also did try to be explicit...</p>
  
  <pre><code>@Bean
  public ViewResolver getViewResolver(){
      InternalResourceViewResolver resolver = new InternalResourceViewResolver();
      resolver.setPrefix("/WEB-INF/jsp/");
      resolver.setSuffix(".jsp");
      return resolver;
  }
  </code></pre>
  
  <p>This doesn't appear to work either.</p>