title: How to display message in webpage using thymeleaf + spark-java web framework?
body: <p>I am writing a small web app using spark-java. I have used thymeleaf as template engine and intellij is the IDE I have been using. The problem I am facing is that variable is not rendering in webpage as it should have. </p>
  
  <p>I have passed <code>todaysdate</code> attribute to the template engine  </p>
  
  <pre><code>public void init() {
      Spark.staticFiles.location("/templates");
      get("/", (req, res) -&gt; {
          Map&lt;String, Object&gt; model = new HashMap&lt;String, Object&gt;();
          DateModel dateModel = getDate();
          String date = "Monday 6, May 2019";
          model.put("todaysdate", date);
          return render(model, "index");
      });
  }
  
  private String render(Map&lt;String, Object&gt; model, String pageName){
      return new ThymeleafTemplateEngine().render(
              new ModelAndView(model, pageName)
      );
  }
  </code></pre>
  
  <p>My html code contains the following code snipped</p>
  
  <pre><code>&lt;div class="col-2 date" id="currentdate" th:text="${todaysdate}"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>But the text is not displayed on the webpage. Intellij is saying cannot resolve <code>todaysdate</code>.</p>