title: Spring-Boot Not Finding JSP Pages in WAR File
body: <p>When running a spring-boot project (java -jar /path/to/war.war) .jsp files are not found.</p>
  
  <p>Methods annotated with @ResponseBody work fine. The view resolver is coming up with the correct path to the JSP pages, but they are not found. This project has one configuration class and no web.xml.</p>
  
  <p><strong>Configuration Class:</strong></p>
  
  <pre><code>@Configuration
  @EnableAutoConfiguration
  @EnableWebMvc
  @ComponentScan (basePackages = "org.ghc.security.web")
  class ScMain extends WebMvcConfigurerAdapter {
  
  
      // SpringBoot BootStrap...
      static void main (String[] args) {
          ApplicationContext ctx = SpringApplication.run (ScMain, args)
  
          System.out.println("Let's inspect the beans provided by Spring Boot:");
  
          String[] beanNames = ctx.getBeanDefinitionNames();
          Arrays.sort(beanNames);
          beanNames.each { beanName -&gt;
              System.out.println(beanName);
          }
      }
  
  
      @Bean
      InternalResourceViewResolver internalResourceViewResolver () {
          InternalResourceViewResolver viewResolver = new InternalResourceViewResolver()
          viewResolver.setPrefix("/WEB-INF/jsp/")
          viewResolver.setSuffix(".jsp")
          viewResolver
      }
  }
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>@Controller
  class Running {
  
      @RequestMapping ("/alive")  // This works fine
      @ResponseBody
      String amIAlive () {
          "ALIVE!"
      }
  
  
      @RequestMapping ("/alive/page")  // Path to page resolved, but file not found!
      ModelAndView amIAlivePage () {
          new ModelAndView("alivepage")
      }
  }
  </code></pre>
  
  <p><strong>Error Log</strong></p>
  
  <blockquote>
    <p>2013-11-25 09:08:28.714 ERROR 1549 --- [tp1945397783-20] org.apache.jasper.servlet.JspServlet     : PWC6117: File "%2FUsers%2Fnode42%2FDevelopment%2Fmock-security-ui%2Fbuild%2Flibs%2Fmock-security-ui-2.06-SNAPSHOT.war%2FWEB-INF%2Fjsp%2Falivepage.jsp" not found</p>
  </blockquote>
  
  <p>The path to the .war file in the log entry is correct, and the path in the war file (WEB-INF/jsp/alivepage.jsp) is correct. The response is the same whether using Jetty or Tomcat (the above log was from Jetty). I have also tried not using the view resolver, specifying one as above, or setting the view resolver through properties. I am completely flummoxed as everything actually looks like it is working, except for this one little detail. And the @ResponseBody annotated method in the controller works fine.</p>
  
  <p>If anyone has any suggestions I'd certainly appreciate the input!</p>