title: Spring Boot - Correct way to map both JSP and REST URI to be handled in controller?
body: <p>I have a problem with Spring boot 1.5.2, I also added all the dependencies for JSP so it could return from web application (war) file.</p>
  
  <p>application.properties</p>
  
  <pre><code>spring.mvc.view.prefix: /WEB-INF/jsp/
  spring.mvc.view.suffix: .jsp
  </code></pre>
  
  <p>pom.xml with JSP dependencies</p>
  
  <pre><code>&lt;!-- JSTL for JSP --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;jstl&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Need this to compile JSP --&gt;
      &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;!-- Need this to compile JSP,
      tomcat-embed-jasper version is not working, no idea why --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.jdt.core.compiler&lt;/groupId&gt;
          &lt;artifactId&gt;ecj&lt;/artifactId&gt;
          &lt;version&gt;4.6.1&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;       
  </code></pre>
  
  <p>And I have a simple controller like this</p>
  
  <pre><code>@Controller
  public class ClassController {
      @RequestMapping("/**")
      public String handle(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
         // This one can handle any rest URIs, e.g: localhost:8080/application/abc, localhost:8080/application/abc/12/asdasd/3123,...
      }
  }
  </code></pre>
  
  <p>However, I could not return index.jsp from localhost:8080/application/index.jsp as it will not invoke the method handle, but return </p>
  
  <pre><code>Whitelabel Error Page
  
  This application has no explicit mapping for /error, so you are seeing this as a fallback.
  
  Mon Oct 02 10:20:39 CEST 2017
  There was an unexpected error (type=Not Found, status=404).
  </code></pre>
  
  <p>What is the proper configuration, so I could direct request with .jsp (e.g: <a href="http://localhost:8080/application/index.jsp" rel="nofollow noreferrer">http://localhost:8080/application/index.jsp</a>) to jsp file (WEB-INF/jsp/index.jsp), and REST uri (<a href="http://localhost:8080/application/132/21321312/324" rel="nofollow noreferrer">http://localhost:8080/application/132/21321312/324</a>) to the handle method?</p>