title: How do I load HashMap and ModelandView object values using Thymeleaf in a Spring Boot application?
body: <p>I am unable to load the input and instance values in the browser from the HTML file using Thymeleaf for a Spring-boot application.</p>
  
  <p>Below is code snippet from Controller java file.</p>
  
  <pre><code>@RequestMapping(value = "/x")
  public String launch(@RequestParam("inputFile") String inputFile, @RequestParam("instance") int instance) {
  
      ...
      ModelAndView mav = new ModelAndView();
  
      Map&lt;String, String&gt; parameters = new HashMap&lt;&gt;();
  
      parameters.put("inputFile", inputFile);
      parameters.put("instance", Integer.toString(instance));
      mav.addObject("parameters", parameters);
  
      mav.setViewName("welcome");
  
      return "welcome";
  }
  </code></pre>
  
  <p>Here is the code from welcome.html:</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html xmlns:th="http://www.thymeleaf.org"&gt;
  &lt;head&gt;
      &lt;title&gt;Title&lt;/title&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="container"&gt;
      &lt;div class="starter-template"&gt;
          &lt;h1&gt;Success!&lt;/h1&gt;
          &lt;h2&gt;&lt;span th:text="inputFile: ${parameters.inputFile}"&gt;&lt;/span&gt;&lt;/h2&gt;
          &lt;h3&gt;&lt;span th:text="instance: ${parameters.instance}"&gt;&lt;/span&gt;&lt;/h3&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is the error I get on the browser:</p>
  
  <blockquote>
    <p>Could not parse as expression: "inputFile: ${parameters.inputFile}" (welcome:16)</p>
  </blockquote>