title: Display list of values on JSP using Spring
body: <p>I would like to display my List of values in my jsp view, but i am not able to do this. </p>
  
  <p>Here is my controller class below, which is only add List to the <code>ModelAndView</code> map and than it redirects to my <code>index.jsp</code> page.</p>
  
  <p><strong>EmployeeController</strong></p>
  
  <pre><code>@Controller
  public class EmployeeController {
  
  @RequestMapping(value={"/employee"}, method = RequestMethod.GET)
  public String listEmployee(){    
      System.out.println("Kontroler EmployeeController");
      LinkedList&lt;String&gt; list = getList();
      ModelAndView map = new ModelAndView("index");
      map.addObject("lists", list);
  
      return map.getViewName();
  }
  
  private LinkedList&lt;String&gt; getList(){
      LinkedList&lt;String&gt; list = new LinkedList&lt;&gt;();
  
      list.add("Item 1");
      list.add("Item 2");
      list.add("Item 3");
  
      return list;
  }
  
  }
  </code></pre>
  
  <p><strong>index.jsp</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;title&gt;Welcome to Spring Web MVC project&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;h1&gt;Index page&lt;/h1&gt;
      &lt;h1&gt;${msg}&lt;/h1&gt;
      &lt;a href="/MavenHello/employee"&gt;Zaměstnanci&lt;/a&gt;
  &lt;/body&gt;
      &lt;c:if test="${not empty listEmployee}"&gt;
  
      &lt;ul&gt;
          &lt;c:forEach var="listValue" items="${listEmployee}"&gt;
              &lt;li&gt;${listValue}&lt;/li&gt;
          &lt;/c:forEach&gt;
      &lt;/ul&gt;
  
  &lt;/c:if&gt;
  </code></pre>
  
  <p></p>
  
  <p>I am able to access the controller, because every time I hit <code>"Zaměstnanci"</code>, the <code>System.out.println("Kontroler EmployeeController")</code> prints <code>"Kontroler EmployeeController"</code> in to Tomcat Log, but the <code>index.jsp</code> page is blank. </p>
  
  <p>Please, can someone give me an advice?</p>