title: How to add next and previous buttons to my pager row
body: <p>How would I add next/previous buttons to this snippet, cause as you can see ,it will display as many links as it needs, so if you have a high number of pages then this might not be the best solution </p>
  
  <pre><code> &lt;c:choose&gt;
     &lt;c:when test="${pages &gt;1}"&gt;
          &lt;div class="pagination art-hiddenfield" &gt;
               &lt;c:forEach var="i" begin="1"end="${pages}" step="1"&gt;
                    &lt;c:url value="MaintenanceListVehicles.htm" var="url"&gt;
                        &lt;c:param name="current" value="${i}"/&gt;                
                    &lt;/c:url&gt;
                    &lt;c:if test="${i==current}"&gt;
                         &lt;a href="&lt;c:out value="${url}"/&gt; " class="current" &gt;
                             &lt;c:out value="${i}" /&gt;&lt;/a&gt;
                    &lt;/c:if&gt;
                    &lt;c:if test="${i!=current}"&gt;
                         &lt;a href="&lt;c:out value="${url}"/&gt; " &gt;
                             &lt;c:out value="${i}" /&gt;&lt;/a&gt;
                    &lt;/c:if&gt;
                &lt;/c:forEach&gt;
           &lt;/div&gt;
      &lt;/c:when&gt;
      &lt;c:otherwise&gt;
         &lt;div align="center"&gt;                   
         &lt;/div&gt;
      &lt;/c:otherwise&gt;
  &lt;/c:choose&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>.pagination .current {
      background: #26B;
      border: 1px solid #226EAD;
      color: white;
  }
  .pagination a {
      display: block;
      border: 1px solid #226EAD;
      color: #15B;
      text-decoration: none;
      float: left;
      margin-bottom: 5px;
      margin-right: 5px;
      padding: 0.3em 0.5em;
  }
  .pagination {
      font-size: 80%;
      float: right;
  }
  div {
      display: block;
  }
  </code></pre>
  
  <p>This is what I get with my current code:
  <img src="https://i.stack.imgur.com/8qGKO.jpg" alt="enter image description here">
  And this is what I'd like to display, with ellipsis if possible
  <img src="https://i.stack.imgur.com/DGbvJ.jpg" alt="enter image description here"></p>
  
  <p>Hope you can help me out.</p>