CollegeListView.jsp
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="s"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ page isELIgnored="false"%>
<h1>College List</h1>
<form:form commandName="collegeForm" method="post">
<form:hidden path="pageNo" />
<form:hidden path="pageSize" />
Name : <form:input path="name" />
<input type="submit" value="Search" name="operation">
<table border="1" >
<tr>
<th><input type="checkbox"></th>
<th>ID</th>
<th>Name</th>
<th>Address</th>
<th>State</th>
<th>City</th>
<th>Phone</th>
<th>Edit</th>
</tr>
<s:forEach items="${list}" var="college" varStatus="loop">
<tr>
<td><input type="checkbox" name="ids" value="${college.id}"></td>
<td>${loop.index + 1 + ((collegeForm.pageNo -1) *
collegeForm.pageSize)}</td>
<td>${college.name}</td>
<td>${college.address}</td>
<!-- You can also use s:out tag to display a value -->
<td><s:out value="${college.state}" /></td>
<td><s:out value="${college.city}" /></td>
<td><s:out value="${college.phoneNo}"></s:out></td>
<td><a href="../College?id=${college.id}">Edit</a></td>
</tr>
</s:forEach>
<s:if test="${empty list}">
<tr>
<td colspan="8">
<H2 style="color: red">Records not found</H2>
</td>
</tr>
</s:if>
<tr>
<td colspan="2"><input type="submit" value="Previous" name="operation"></td>
<td align="center" colspan="4">
<input type="submit" value="Delete" name="operation">
<input type="submit" value="New" name="operation">
</td>
<td colspan="2" align="right"><input type="submit" value="Next" name="operation"></td>
</tr>
</table>
</form:form>