title: How to create view resolver for html in Spring?
body: <p>I have faced the problem when decided to create a web-app without JSPs, but using only HTML-pages which are under directory WEB-INF/pages.</p>
  
  <p>I've made the view resolver:</p>
  
  <pre><code>&lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;property name="prefix" value="WEB-INF/pages/"/&gt;
      &lt;property name="suffix" value=""/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Also I've imported all the resources in WEB-INF/pages:</p>
  
  <pre><code>&lt;mvc:resources mapping="/**" location="WEB-INF/pages/"/&gt;
  </code></pre>
  
  <p>My controller have the following view:</p>
  
  <pre><code>@PreAuthorize("isAuthenticated()")
  @RequestMapping("/")
  public String indexPage() {
      return "redirect:/index.html";
  }
  </code></pre>
  
  <p>It works fine for mapping "/" (redirects to login page if not authenticated), but it is not secured for url "/index.html" due to importing of this page as static resource (but it will not work at all if not import it).</p>