title: Could not resolve view with name 'index' in Spring Boot
body: <p>Spring boot: 2.3.3.RELEASE</p>
  <p>Java: 11</p>
  <p>I use webflux + RouterFunction + Thymeleaf and encounter the error &quot;Could not resolve view with name 'index'&quot;.</p>
  <p>index.html is under &quot;resources/templates&quot;.
  I put some source code looks important.</p>
  <p>Are we not able to use Thymeleaf if we use &quot;RouterFunction&quot;?</p>
  <p>Please feel free to put a comment if you need more detail.</p>
  <pre><code>######## handler ###########
  @Component
  public class ItemHandler {
  
  public RouterFunction&lt;ServerResponse&gt; routes = route()
          .path(&quot;/item&quot;, builder -&gt; builder.GET(&quot;/&quot;, this::index))
          .build();
  
  public Mono&lt;ServerResponse&gt; index(ServerRequest request) {
      Map&lt;String, Object&gt; attributes = new HashMap&lt;&gt;();
      attributes.put(&quot;items&quot;, &quot;Hello&quot;);
  
      return ServerResponse.ok().contentType(MediaType.TEXT_HTML)
              .render(&quot;index&quot;, attributes);
  }
  }
  
  
  ######## index.html ###########
  &lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;ja&quot;
        xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
        xmlns:th=&quot;http://www.thymeleaf.org&quot;&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;FluxTest&lt;/h1&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  ######## entry point ###########
  @SpringBootApplication
  public class DemoWebfluxApplication {
      public static void main(String[] args) {
          SpringApplication.run(DemoWebfluxApplication.class, args);
      }
  }
  </code></pre>