Spring MVC how to display data from database into a table
<p>I am very new with SPRING MVC so really I dont know much about it as of the moment. I want to display all the fields in the database in a table view how do I do this?</p>

<p>in my controller</p>

<pre><code>@RequestMapping(value = "task", method = RequestMethod.GET)
  public String taskList(Map&lt;String, Object&gt; model) {
            model.put("task", taskRepository.findAll());
        return "/tasks/list";
      }
</code></pre>

<p>my jsp:</p>

<pre><code>&lt;%@include file="/WEB-INF/views/includes/header.jsp"%&gt;

&lt;h4 class="form-header"&gt;${title}&lt;/h4&gt;

&lt;div class="forms col-md-12 bounceInDown mainContent" data-wow-delay="0.2s"&gt;



&lt;table class="table table-striped"&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Task ID&lt;/th&gt;
      &lt;th&gt;Task Name&lt;/th&gt;
      &lt;th&gt;Task Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;c:if test="${empty task}"&gt;
      &lt;tr&gt;
        &lt;td colspan="8"&gt;No task to Display&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/c:if&gt;
    &lt;c:if test="${not empty task}"&gt;

      &lt;c:forEach items="${tasks}" var="task"&gt;
        &lt;tr class=""&gt;
          &lt;td&gt;${task.taskid}&lt;/td&gt;
          &lt;td&gt;${task.taskName}&lt;/td&gt;
          &lt;td&gt;${task.taskDescription}&lt;/td&gt;
          &lt;td&gt;
            &lt;fmt:message key="task.list.status.text.${task.status}" /&gt;
          &lt;/td&gt;

        &lt;/tr&gt;
      &lt;/c:forEach&gt;
    &lt;/c:if&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;%@include file="/WEB-INF/views/includes/footer.jsp"%&gt;
</code></pre>

<p>i dont have anything inside my taskRepository atm </p>