title: Spring MVC cannot find *.jsp files
body: <p>I am an absolute noob when it comes to web development. But I got some background in C/C++/Java so I don't have a problem with MVC controllers. It's the configuration that is giving me the headache.</p>
  
  <p>I am using Spring Boot. And according to the tutorials it can magically resolve everything without even opening an editor and typing a single character. Apparently not.</p>
  
  <p>I have a view resolver configure as such:</p>
  
  <pre><code>@Configuration
  @ComponentScan (basePackages = {"my.test.controller"})
  @EnableAutoConfiguration
  public class WebConfig extends WebMvcConfigurerAdapter {
      @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
         registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
    }
  
  @Bean
      public InternalResourceViewResolver getViewResolver(){
          InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
          viewResolver.setViewClass(JstlView.class);
          viewResolver.setPrefix("/WEB-INF/views/");
          viewResolver.setSuffix(".jsp");
          return viewResolver;
     }
  
  
  
     public static void main(String[] args) throws Exception {
         SpringApplication.run(WebConfig.class, args);
     }
  
  }
  </code></pre>
  
  <p>I have a controller like this:</p>
  
  <pre><code>@Controller
  public class PageController {
  
  @RequestMapping(value = "/index")
  public String doSomething() {
  
          //.. do Something
  
          return "/index";
      }
  </code></pre>
  
  <p>My main problem is it cannot find the file if there is a jsp extension in the address.
  If I type the url without an extension like localhost:8080/index the page is displayed properly. 
  If I type the url with an extension like localhost:8080/index.jsp the page returns a 404 error. This is the same for all pages declared in the controller. </p>
  
  <p>Any help will be greatly appreciated. Thanks thanks.</p>