StudentList.jsp
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="sf"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ page isELIgnored="false"%>
<h1>Student List</h1>
<h2 class="success">${success}</h2>
<h2 class="error">${error}</h2>
<sf:form action="search" commandName="form" method="post">
<sf:hidden path="pageNo" />
<sf:hidden path="pageSize" />
<s:message code="label.firstName" />
<sf:input path="firstName" />
<s:message code="label.lastName" />
<sf:input path="lastName" />
<input type="submit" value="Search" name="operation">
<table border="1" width="100%">
<c:if test="${!empty list}">
<tr>
<th><input type="checkbox" /></th>
<th>ID</th>
<th><s:message code="label.firstName" /></th>
<th><s:message code="label.lastName" /></th>
<th><s:message code="label.email" /></th>
<th><s:message code="label.mobileNo" /></th>
<th><s:message code="label.collegeName" /></th>
<th><s:message code="label.dob" /></th>
<th>Edit</th>
</tr>
<c:url var="editUrl" value="/ctl/Student?id=" />
<c:forEach items="${list}" var="student" varStatus="ct">
<tr>
<td><input type="checkbox" name="ids" value="${student.id}"></td>
<td><c:out
value="${(form.pageSize * (form.pageNo-1))+ct.index+1}" /></td>
<td><c:out value="${student.firstName}" /></td>
<td><c:out value="${student.lastName}" /></td>
<td><c:out value="${student.email}" /></td>
<td><c:out value="${student.mobileNo}" /></td>
<td><c:out value="${student.collegeName}" /></td>
<td><c:out value="${student.dob}"></c:out></td>
<td><a href="${editUrl}${student.id}">Edit</a></td>
</tr>
</c:forEach>
<tr>
<td align="left"><input type="submit" value="Previous"
name="operation"></td>
<td align="center" colspan="7"><a
href="<c:url value="/ctl/Student" />">New</a> <input
type="submit" value="Delete" name="operation"> </td>
<td align="right"><input type="submit" value="Next"
name="operation"></td>
</tr>
</c:if>
</table>
</sf:form>