src/main/webapp/WEB-INF/views/Paradigms/index.jsp:
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@taglib uri="http://easyweb4j.sourceforge.net/easyweb4j" prefix="e" %> <a href="${contextRoot}/Paradigms/add">Add New</a> <p /> <span style="color: green">${flash['paradigmSuccess']}</span> <p /> <table> <tr> <th>Name</th> <th>Description</th> <th></th> </tr> <c:forEach items="${paradigms}" var="paradigm"> <tr> <td> <c:out value="${paradigm.name}" /> </td> <td> <c:out value="${paradigm.description}" /> </td> <td> <a href="${contextRoot}/Paradigms/edit/${paradigm.id}">Edit</a> <e:postLink onclick="if(!window.confirm('Are you sure?')) return false;" href="${contextRoot}/Paradigms/delete/${paradigm.id}"> Delete </e:postLink> </td> </tr> </c:forEach> </table>
src/main/webapp/WEB-INF/views/Paradigms/paradigmForm.jsp:
<%@taglib uri="http://easyweb4j.sourceforge.net/easyweb4j" prefix="e" %> <label for="name">Name:</label> <input type="text" id="name" name="paradigm.name" value="${paradigm.name}" /> <span style="color: red"><e:message key="${paradigm.errors['name']}" /></span> <p /> <label for="description">Description:</label> <input type="text" id="description" name="paradigm.description" value="${paradigm.description}" /> <span style="color: red"><e:message key="${paradigm.errors['description']}" /></span> <p /> <input type="submit" value="Save" /> <a href="${contextRoot}/Paradigms">Back</a>
src/main/webapp/WEB-INF/views/Paradigms/add.jsp:
<form action="${contextRoot}/Paradigms/create" method="post"> <%@include file="paradigmForm.jsp" %> </form>
src/main/webapp/WEB-INF/views/Paradigms/edit.jsp:
<form action="${contextRoot}/Paradigms/update/${paradigm.id}" method="post"> <%@include file="paradigmForm.jsp" %> </form>