title: Springboot won't load my HTML page using Thymeleaf
body: <p>Already been on these topics but haven't worked for me:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/31876389/how-to-serve-static-html-content-page-in-spring-boot">Topic1</a> No <code>@EnableWebMvc</code> annotation in my project</li>
  </ol>
  
  <p>This is the dependency i used for <code>Thymeleaf</code>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>
  &lt;!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.thymeleaf&lt;/groupId&gt;
      &lt;artifactId&gt;thymeleaf&lt;/artifactId&gt;
      &lt;version&gt;3.0.11.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  
  </code></pre>
  
  <ul>
  <li>My new Controller named <code>ViewController</code></li>
  </ul>
  
  <pre class="lang-java prettyprint-override"><code>package myrest.Viewcontroller;
  
  //Imports
  
  @Controller
  public class ViewController {
  
  
      public static String uploadDirectory = System.getProperty("user.dir")+"/uploads";
      @RequestMapping("/uploadendpoint")
      public String uploadPage(Model model)
      {
          return "uploadView";
      }
  
  }
  </code></pre>
  
  <ul>
  <li>The <code>HTML</code> named <code>uploadView.html</code></li>
  </ul>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns:th="http://www.thymeleaf.org"&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;&lt;/meta&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;form action = "/upload" method="post" enctype="multipart/form-data"&gt;
      &lt;input type="file" name="files" multiple&gt;
      &lt;input type="submit" value="Upload Files"&gt;&lt;/input&gt;
  
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  
  </code></pre>
  
  <ul>
  <li>Project's structure:</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/loy4H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/loy4H.png" alt="enter image description here"></a></p>
  
  <p>My Comments: I'm still getting a <strong>Whitelabel Error Page</strong> , at <code>localhost:8082/uploadendpoint</code></p>
  
  <p><strong>Edit1:</strong></p>
  
  <p>My <code>@SpringBootApplication</code> class</p>
  
  <pre class="lang-java prettyprint-override"><code>package myrest;
  
  import java.io.File;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.context.annotation.ComponentScan;
  
  import myrest.Viewcontroller.ViewController;
  import myrest.controller.MainController;
  
  @SpringBootApplication
  public class RemoteapiApplication {
  
      public static void main(String[] args) {
          new File(ViewController.uploadDirectory).mkdir();
          SpringApplication.run(RemoteapiApplication.class, args);
      }
  
  }
  
  </code></pre>
  
  <p><code>application.properties</code> file:</p>
  
  <pre><code>server.port:8082
  spring.servlet.multipart.max-file-size=15MB
  spring.servlet.multipart.max-request-size=15MB
  </code></pre>
  
  <p>Server's <code>logs</code></p>
  
  <pre><code>2020-01-07 14:37:56.708  INFO 9317 --- [  restartedMain] myrest.RemoteapiApplication              : Starting RemoteapiApplication on ZenbookPro with PID 9317 (/home/pihill/Documents/workspace-sts-3.9.9.RELEASE/remoteapi/target/classes started by pihill in /home/pihill/Documents/workspace-sts-3.9.9.RELEASE/remoteapi)
  2020-01-07 14:37:56.708  INFO 9317 --- [  restartedMain] myrest.RemoteapiApplication              : No active profile set, falling back to default profiles: default
  2020-01-07 14:37:56.770  WARN 9317 --- [  restartedMain] org.apache.tomcat.util.modeler.Registry  : The MBean registry cannot be disabled because it has already been initialised
  2020-01-07 14:37:56.781  INFO 9317 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8082 (http)
  2020-01-07 14:37:56.782  INFO 9317 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
  2020-01-07 14:37:56.782  INFO 9317 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.29]
  2020-01-07 14:37:56.784  INFO 9317 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
  2020-01-07 14:37:56.784  INFO 9317 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 75 ms
  2020-01-07 14:37:56.801  INFO 9317 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
  2020-01-07 14:37:56.814  INFO 9317 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
  2020-01-07 14:37:56.820  INFO 9317 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8082 (http) with context path ''
  2020-01-07 14:37:56.820  INFO 9317 --- [  restartedMain] myrest.RemoteapiApplication              : Started RemoteapiApplication in 0.119 seconds (JVM running for 2930.389)
  2020-01-07 14:37:56.821  INFO 9317 --- [  restartedMain] .ConditionEvaluationDeltaLoggingListener : Condition evaluation unchanged
  2020-01-07 14:37:59.725  INFO 9317 --- [nio-8082-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
  2020-01-07 14:37:59.726  INFO 9317 --- [nio-8082-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
  2020-01-07 14:37:59.727  INFO 9317 --- [nio-8082-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
  
  </code></pre>
  
  <p>Whitelabel error page:</p>
  
  <p><a href="https://i.stack.imgur.com/lZqxa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lZqxa.png" alt="enter image description here"></a></p>