title: How do I add simple pagination for Spring MVC
body: <p>This is my controller for Users view page:</p>
  
  <pre><code>@RequestMapping(value="/list")
      public ModelAndView listOfUsers() {
          ModelAndView modelAndView = new ModelAndView("list-of-users");
  
          List&lt;User&gt; users = userService.getUsers();
          PagedListHolder&lt;User&gt; pagedListHolder = new PagedListHolder&lt;&gt;(users);
          //pagedListHolder.setPageSize(1);
          modelAndView.addObject("users", pagedListHolder);
  
          return modelAndView;
      }
  </code></pre>
  
  <p>And this is my JSP page:</p>
  
  <pre><code>&lt;%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
  
  &lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
  
  &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /&gt;
  &lt;title&gt;List of users&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;List of users&lt;/h1&gt;
  &lt;p&gt;Here you can see the list of the users, edit them, remove or update.&lt;/p&gt;
  &lt;table border="1px" cellpadding="0" cellspacing="0" &gt;
  &lt;thead&gt;
  &lt;tr&gt;
  &lt;th width="10%"&gt;id&lt;/th&gt;&lt;th width="15%"&gt;name&lt;/th&gt;&lt;th width="10%"&gt;age&lt;/th&gt;&lt;th width="10%"&gt;is Admin?&lt;/th&gt;&lt;th width="10%"&gt;create date&lt;/th&gt;&lt;th width="10%"&gt;actions&lt;/th&gt;
  &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
  &lt;c:forEach var="user" items="${users.pageList}"&gt;
  &lt;tr&gt;
      &lt;td&gt;${user.id}&lt;/td&gt;
      &lt;td&gt;${user.name}&lt;/td&gt;
      &lt;td&gt;${user.age}&lt;/td&gt;
      &lt;td&gt;${user.isAdmin}&lt;/td&gt;
      &lt;td&gt;${user.createdDate}&lt;/td&gt;
      &lt;td&gt;
      &lt;a href="${pageContext.request.contextPath}/user/edit/${user.id}.html"&gt;Edit&lt;/a&gt;&lt;br/&gt;
      &lt;a href="${pageContext.request.contextPath}/user/delete/${user.id}.html"&gt;Delete&lt;/a&gt;&lt;br/&gt;
      &lt;/td&gt;
  
  &lt;/tr&gt;
  &lt;/c:forEach&gt;
  &lt;p&gt;&lt;a href="${pageContext.request.contextPath}/user/search-users.html"&gt;Search&lt;/a&gt;&lt;/p&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  
  &lt;p&gt;&lt;a href="${pageContext.request.contextPath}/index.html"&gt;Home page&lt;/a&gt;&lt;/p&gt;
  
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>How can I add simple pagination to this?</p>