petclinic-uncached
Changes
src/main/webapp/WEB-INF/jsp/owners/form.jsp 134(+75 -59)
src/main/webapp/WEB-INF/jsp/owners/list.jsp 79(+48 -31)
src/main/webapp/WEB-INF/jsp/owners/show.jsp 210(+106 -104)
src/main/webapp/WEB-INF/jsp/pets/form.jsp 118(+66 -52)
src/main/webapp/WEB-INF/jsp/pets/visitForm.jsp 143(+80 -63)
src/main/webapp/WEB-INF/jsp/uncaughtException.jsp 103(+59 -44)
src/main/webapp/WEB-INF/jsp/vets.jsp 80(+49 -31)
src/main/webapp/WEB-INF/jsp/welcome.jsp 34(+17 -17)
Details
diff --git a/src/main/webapp/WEB-INF/jsp/dataAccessFailure.jsp b/src/main/webapp/WEB-INF/jsp/dataAccessFailure.jsp
index 256cca1..5674cab 100644
--- a/src/main/webapp/WEB-INF/jsp/dataAccessFailure.jsp
+++ b/src/main/webapp/WEB-INF/jsp/dataAccessFailure.jsp
@@ -1,19 +1,30 @@
-<%@ include file="/WEB-INF/jsp/includes.jsp" %>
-<%@ include file="/WEB-INF/jsp/header.jsp" %>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
-<%
-Exception ex = (Exception) request.getAttribute("exception");
-%>
-<h2>Data access failure: <%= ex.getMessage() %></h2>
-<p/>
+<html lang="en">
-<%
-ex.printStackTrace(new java.io.PrintWriter(out));
-%>
+<jsp:include page="header.jsp"/>
-<p/>
-<br/>
-<a href="<spring:url value="/" htmlEscape="true" />">Home</a>
+<body>
+ <div id="main">
+ <%
+ Exception ex = (Exception) request.getAttribute("exception");
+ %>
+
+ <h2>Data access failure: <%= ex.getMessage() %></h2>
+ <p/>
+
+ <%
+ ex.printStackTrace(new java.io.PrintWriter(out));
+ %>
+
+ <p/>
+ <br/>
+ <a href="<spring:url value="/" htmlEscape="true" />">Home</a>
+
+ </div>
+ <jsp:include page="footer.jsp"/>
-<%@ include file="/WEB-INF/jsp/footer.jsp" %>
+</body>
+
+</html>
src/main/webapp/WEB-INF/jsp/owners/form.jsp 134(+75 -59)
diff --git a/src/main/webapp/WEB-INF/jsp/owners/form.jsp b/src/main/webapp/WEB-INF/jsp/owners/form.jsp
index b4c2b21..208f521 100644
--- a/src/main/webapp/WEB-INF/jsp/owners/form.jsp
+++ b/src/main/webapp/WEB-INF/jsp/owners/form.jsp
@@ -1,61 +1,77 @@
-<%@ include file="/WEB-INF/jsp/includes.jsp" %>
-<%@ include file="/WEB-INF/jsp/header.jsp" %>
-<c:choose>
- <c:when test="${owner['new']}"><c:set var="method" value="post"/></c:when>
- <c:otherwise><c:set var="method" value="put"/></c:otherwise>
-</c:choose>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
-<h2><c:if test="${owner['new']}">New </c:if>Owner:</h2>
-<form:form modelAttribute="owner" method="${method}">
- <table>
- <tr>
- <th>
- First Name: <form:errors path="firstName" cssClass="errors"/>
- <br/>
- <form:input path="firstName" size="30" maxlength="80"/>
- </th>
- </tr>
- <tr>
- <th>
- Last Name: <form:errors path="lastName" cssClass="errors"/>
- <br/>
- <form:input path="lastName" size="30" maxlength="80"/>
- </th>
- </tr>
- <tr>
- <th>
- Address: <form:errors path="address" cssClass="errors"/>
- <br/>
- <form:input path="address" size="30" maxlength="80"/>
- </th>
- </tr>
- <tr>
- <th>
- City: <form:errors path="city" cssClass="errors"/>
- <br/>
- <form:input path="city" size="30" maxlength="80"/>
- </th>
- </tr>
- <tr>
- <th>
- Telephone: <form:errors path="telephone" cssClass="errors"/>
- <br/>
- <form:input path="telephone" size="20" maxlength="20"/>
- </th>
- </tr>
- <tr>
- <td>
- <c:choose>
- <c:when test="${owner['new']}">
- <p class="submit"><input type="submit" value="Add Owner"/></p>
- </c:when>
- <c:otherwise>
- <p class="submit"><input type="submit" value="Update Owner"/></p>
- </c:otherwise>
- </c:choose>
- </td>
- </tr>
- </table>
-</form:form>
-<%@ include file="/WEB-INF/jsp/footer.jsp" %>
+<html lang="en">
+
+<jsp:include page="../header.jsp"/>
+
+<body>
+
+ <div id="main">
+ <c:choose>
+ <c:when test="${owner['new']}"><c:set var="method" value="post"/></c:when>
+ <c:otherwise><c:set var="method" value="put"/></c:otherwise>
+ </c:choose>
+
+ <h2><c:if test="${owner['new']}">New </c:if>Owner:</h2>
+ <form:form modelAttribute="owner" method="${method}">
+ <table>
+ <tr>
+ <th>
+ First Name: <form:errors path="firstName" cssClass="errors"/>
+ <br/>
+ <form:input path="firstName" size="30" maxlength="80"/>
+ </th>
+ </tr>
+ <tr>
+ <th>
+ Last Name: <form:errors path="lastName" cssClass="errors"/>
+ <br/>
+ <form:input path="lastName" size="30" maxlength="80"/>
+ </th>
+ </tr>
+ <tr>
+ <th>
+ Address: <form:errors path="address" cssClass="errors"/>
+ <br/>
+ <form:input path="address" size="30" maxlength="80"/>
+ </th>
+ </tr>
+ <tr>
+ <th>
+ City: <form:errors path="city" cssClass="errors"/>
+ <br/>
+ <form:input path="city" size="30" maxlength="80"/>
+ </th>
+ </tr>
+ <tr>
+ <th>
+ Telephone: <form:errors path="telephone" cssClass="errors"/>
+ <br/>
+ <form:input path="telephone" size="20" maxlength="20"/>
+ </th>
+ </tr>
+ <tr>
+ <td>
+ <c:choose>
+ <c:when test="${owner['new']}">
+ <p class="submit"><input type="submit" value="Add Owner"/></p>
+ </c:when>
+ <c:otherwise>
+ <p class="submit"><input type="submit" value="Update Owner"/></p>
+ </c:otherwise>
+ </c:choose>
+ </td>
+ </tr>
+ </table>
+ </form:form>
+
+ </div>
+ <jsp:include page="../footer.jsp"/>
+</body>
+
+</html>
src/main/webapp/WEB-INF/jsp/owners/list.jsp 79(+48 -31)
diff --git a/src/main/webapp/WEB-INF/jsp/owners/list.jsp b/src/main/webapp/WEB-INF/jsp/owners/list.jsp
index 44fc3ca..b28ce6b 100644
--- a/src/main/webapp/WEB-INF/jsp/owners/list.jsp
+++ b/src/main/webapp/WEB-INF/jsp/owners/list.jsp
@@ -1,34 +1,51 @@
-<%@ include file="/WEB-INF/jsp/includes.jsp" %>
-<%@ include file="/WEB-INF/jsp/header.jsp" %>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+
+
+<html lang="en">
+
+<jsp:include page="../header.jsp"/>
+
+<body>
+
+ <div id="main">
<h2>Owners:</h2>
-<table>
- <thead>
- <th>Name</th>
- <th>Address</th>
- <th>City</th>
- <th>Telephone</th>
- <th>Pets</th>
- </thead>
- <c:forEach var="owner" items="${selections}">
- <tr>
- <td>
- <spring:url value="owners/{ownerId}" var="ownerUrl">
- <spring:param name="ownerId" value="${owner.id}"/>
- </spring:url>
- <a href="${fn:escapeXml(ownerUrl)}">${owner.firstName} ${owner.lastName}</a>
- </td>
- <td>${owner.address}</td>
- <td>${owner.city}</td>
- <td>${owner.telephone}</td>
- <td>
- <c:forEach var="pet" items="${owner.pets}">
- ${pet.name}
- </c:forEach>
- </td>
- </tr>
- </c:forEach>
-</table>
-
-<%@ include file="/WEB-INF/jsp/footer.jsp" %>
+ <table>
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Address</th>
+ <th>City</th>
+ <th>Telephone</th>
+ <th>Pets</th>
+ </tr>
+ </thead>
+ <c:forEach var="owner" items="${selections}">
+ <tr>
+ <td>
+ <spring:url value="owners/{ownerId}" var="ownerUrl">
+ <spring:param name="ownerId" value="${owner.id}"/>
+ </spring:url>
+ <a href="${fn:escapeXml(ownerUrl)}">${owner.firstName} ${owner.lastName}</a>
+ </td>
+ <td>${owner.address}</td>
+ <td>${owner.city}</td>
+ <td>${owner.telephone}</td>
+ <td>
+ <c:forEach var="pet" items="${owner.pets}">
+ ${pet.name}
+ </c:forEach>
+ </td>
+ </tr>
+ </c:forEach>
+ </table>
+
+ </div>
+ <jsp:include page="../footer.jsp"/>
+</body>
+
+</html>
src/main/webapp/WEB-INF/jsp/owners/show.jsp 210(+106 -104)
diff --git a/src/main/webapp/WEB-INF/jsp/owners/show.jsp b/src/main/webapp/WEB-INF/jsp/owners/show.jsp
index cd7334d..077d8cf 100644
--- a/src/main/webapp/WEB-INF/jsp/owners/show.jsp
+++ b/src/main/webapp/WEB-INF/jsp/owners/show.jsp
@@ -11,112 +11,114 @@
<div id="main">
-<h2>Owner Information</h2>
-
- <table>
- <tr>
- <th>Name</th>
- <td><b>${owner.firstName} ${owner.lastName}</b></td>
- </tr>
- <tr>
- <th>Address</th>
- <td>${owner.address}</td>
- </tr>
- <tr>
- <th>City</th>
- <td>${owner.city}</td>
- </tr>
- <tr>
- <th>Telephone </th>
- <td>${owner.telephone}</td>
- </tr>
- </table>
- <table class="table-buttons">
- <tr>
- <td colspan="2" align="center">
- <spring:url value="{ownerId}/edit" var="editUrl">
- <spring:param name="ownerId" value="${owner.id}" />
- </spring:url>
- <a href="${fn:escapeXml(editUrl)}">Edit Owner</a>
- </td>
- <td>
- <spring:url value="{ownerId}/pets/new" var="addUrl">
- <spring:param name="ownerId" value="${owner.id}" />
- </spring:url>
- <a href="${fn:escapeXml(addUrl)}">Add New Pet</a>
- </td>
- </tr>
- </table>
-
- <h2>Pets and Visits</h2>
-
- <c:forEach var="pet" items="${owner.pets}">
- <table width="94%">
- <tr>
- <td valign="top">
- <table>
- <tr>
- <th>Name</th>
- <td><b>${pet.name}</b></td>
- </tr>
- <tr>
- <th>Birth Date</th>
- <td><fmt:formatDate value="${pet.birthDate}" pattern="yyyy-MM-dd"/></td>
- </tr>
- <tr>
- <th>Type</th>
- <td>${pet.type.name}</td>
- </tr>
- </table>
- </td>
- <td valign="top">
- <table>
- <thead>
- <th>Visit Date</th>
- <th>Description</th>
- </thead>
- <c:forEach var="visit" items="${pet.visits}">
- <tr>
- <td><fmt:formatDate value="${visit.date}" pattern="yyyy-MM-dd"/></td>
- <td>${visit.description}</td>
- </tr>
- </c:forEach>
- </table>
- </td>
- </tr>
- </table>
- <table class="table-buttons">
- <tr>
- <td>
- <spring:url value="{ownerId}/pets/{petId}/edit" var="petUrl">
- <spring:param name="ownerId" value="${owner.id}"/>
- <spring:param name="petId" value="${pet.id}"/>
- </spring:url>
- <a href="${fn:escapeXml(petUrl)}">Edit Pet</a>
- </td>
- <td></td>
- <td>
- <spring:url value="{ownerId}/pets/{petId}/visits/new" var="visitUrl">
- <spring:param name="ownerId" value="${owner.id}"/>
- <spring:param name="petId" value="${pet.id}"/>
- </spring:url>
- <a href="${fn:escapeXml(visitUrl)}">Add Visit</a>
- </td>
- <td></td>
- <td>
- <spring:url value="{ownerId}/pets/{petId}/visits.atom" var="feedUrl">
- <spring:param name="ownerId" value="${owner.id}"/>
- <spring:param name="petId" value="${pet.id}"/>
- </spring:url>
- <a href="${fn:escapeXml(feedUrl)}" rel="alternate" type="application/atom+xml">Atom Feed</a>
- </td>
- </tr>
- </table>
- </c:forEach>
+ <h2>Owner Information</h2>
+
+ <table>
+ <tr>
+ <th>Name</th>
+ <td><b>${owner.firstName} ${owner.lastName}</b></td>
+ </tr>
+ <tr>
+ <th>Address</th>
+ <td>${owner.address}</td>
+ </tr>
+ <tr>
+ <th>City</th>
+ <td>${owner.city}</td>
+ </tr>
+ <tr>
+ <th>Telephone </th>
+ <td>${owner.telephone}</td>
+ </tr>
+ </table>
+ <table class="table-buttons">
+ <tr>
+ <td colspan="2" align="center">
+ <spring:url value="{ownerId}/edit" var="editUrl">
+ <spring:param name="ownerId" value="${owner.id}" />
+ </spring:url>
+ <a href="${fn:escapeXml(editUrl)}">Edit Owner</a>
+ </td>
+ <td>
+ <spring:url value="{ownerId}/pets/new" var="addUrl">
+ <spring:param name="ownerId" value="${owner.id}" />
+ </spring:url>
+ <a href="${fn:escapeXml(addUrl)}">Add New Pet</a>
+ </td>
+ </tr>
+ </table>
+
+ <h2>Pets and Visits</h2>
+
+ <c:forEach var="pet" items="${owner.pets}">
+ <table width="94%">
+ <tr>
+ <td valign="top">
+ <table>
+ <tr>
+ <th>Name</th>
+ <td><b>${pet.name}</b></td>
+ </tr>
+ <tr>
+ <th>Birth Date</th>
+ <td><fmt:formatDate value="${pet.birthDate}" pattern="yyyy-MM-dd"/></td>
+ </tr>
+ <tr>
+ <th>Type</th>
+ <td>${pet.type.name}</td>
+ </tr>
+ </table>
+ </td>
+ <td valign="top">
+ <table>
+ <thead>
+ <tr>
+ <th>Visit Date</th>
+ <th>Description</th>
+ </tr>
+ </thead>
+ <c:forEach var="visit" items="${pet.visits}">
+ <tr>
+ <td><fmt:formatDate value="${visit.date}" pattern="yyyy-MM-dd"/></td>
+ <td>${visit.description}</td>
+ </tr>
+ </c:forEach>
+ </table>
+ </td>
+ </tr>
+ </table>
+ <table class="table-buttons">
+ <tr>
+ <td>
+ <spring:url value="{ownerId}/pets/{petId}/edit" var="petUrl">
+ <spring:param name="ownerId" value="${owner.id}"/>
+ <spring:param name="petId" value="${pet.id}"/>
+ </spring:url>
+ <a href="${fn:escapeXml(petUrl)}">Edit Pet</a>
+ </td>
+ <td></td>
+ <td>
+ <spring:url value="{ownerId}/pets/{petId}/visits/new" var="visitUrl">
+ <spring:param name="ownerId" value="${owner.id}"/>
+ <spring:param name="petId" value="${pet.id}"/>
+ </spring:url>
+ <a href="${fn:escapeXml(visitUrl)}">Add Visit</a>
+ </td>
+ <td></td>
+ <td>
+ <spring:url value="{ownerId}/pets/{petId}/visits.atom" var="feedUrl">
+ <spring:param name="ownerId" value="${owner.id}"/>
+ <spring:param name="petId" value="${pet.id}"/>
+ </spring:url>
+ <a href="${fn:escapeXml(feedUrl)}" rel="alternate" type="application/atom+xml">Atom Feed</a>
+ </td>
+ </tr>
+ </table>
+ </c:forEach>
-<jsp:include page="../footer.jsp"/>
+ </div>
- </div>
+ <jsp:include page="../footer.jsp"/>
</body>
</html>
src/main/webapp/WEB-INF/jsp/pets/form.jsp 118(+66 -52)
diff --git a/src/main/webapp/WEB-INF/jsp/pets/form.jsp b/src/main/webapp/WEB-INF/jsp/pets/form.jsp
index 12f503d..ec06dc1 100644
--- a/src/main/webapp/WEB-INF/jsp/pets/form.jsp
+++ b/src/main/webapp/WEB-INF/jsp/pets/form.jsp
@@ -1,56 +1,70 @@
-<%@ include file="/WEB-INF/jsp/includes.jsp" %>
-<%@ include file="/WEB-INF/jsp/header.jsp" %>
-<c:choose>
- <c:when test="${pet['new']}"><c:set var="method" value="post"/></c:when>
- <c:otherwise><c:set var="method" value="put"/></c:otherwise>
-</c:choose>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
-<h2><c:if test="${pet['new']}">New </c:if>Pet</h2>
-<b>Owner:</b> ${pet.owner.firstName} ${pet.owner.lastName}
-<br/>
-<form:form modelAttribute="pet" method="${method}">
- <table>
- <tr>
- <th>
- Name: <form:errors path="name" cssClass="errors"/>
- <br/>
- <form:input path="name" size="30" maxlength="30"/>
- </th>
- </tr>
- <tr>
- <th>
- Birth Date: <form:errors path="birthDate" cssClass="errors"/>
- <br/>
- <form:input path="birthDate" size="10" maxlength="10"/> (yyyy-mm-dd)
- </th>
- </tr>
- <tr>
- <th>
- Type: <form:errors path="type" cssClass="errors"/>
- <br/>
- <form:select path="type" items="${types}"/>
- </th>
- </tr>
- <tr>
- <td>
- <c:choose>
- <c:when test="${pet['new']}">
- <p class="submit"><input type="submit" value="Add Pet"/></p>
- </c:when>
- <c:otherwise>
- <p class="submit"><input type="submit" value="Update Pet"/></p>
- </c:otherwise>
- </c:choose>
- </td>
- </tr>
- </table>
-</form:form>
+<html lang="en">
-<c:if test="${!pet['new']}">
- <form:form method="delete">
- <p class="submit"><input type="submit" value="Delete Pet"/></p>
- </form:form>
-</c:if>
+<jsp:include page="../header.jsp"/>
-<%@ include file="/WEB-INF/jsp/footer.jsp" %>
+<body>
+
+ <div id="main">
+ <c:choose>
+ <c:when test="${pet['new']}"><c:set var="method" value="post"/></c:when>
+ <c:otherwise><c:set var="method" value="put"/></c:otherwise>
+ </c:choose>
+
+ <h2><c:if test="${pet['new']}">New </c:if>Pet</h2>
+
+ <b>Owner:</b> ${pet.owner.firstName} ${pet.owner.lastName}
+ <br/>
+ <form:form modelAttribute="pet" method="${method}">
+ <table>
+ <tr>
+ <th>
+ Name: <form:errors path="name" cssClass="errors"/>
+ <br/>
+ <form:input path="name" size="30" maxlength="30"/>
+ </th>
+ </tr>
+ <tr>
+ <th>
+ Birth Date: <form:errors path="birthDate" cssClass="errors"/>
+ <br/>
+ <form:input path="birthDate" size="10" maxlength="10"/> (yyyy-mm-dd)
+ </th>
+ </tr>
+ <tr>
+ <th>
+ Type: <form:errors path="type" cssClass="errors"/>
+ <br/>
+ <form:select path="type" items="${types}"/>
+ </th>
+ </tr>
+ <tr>
+ <td>
+ <c:choose>
+ <c:when test="${pet['new']}">
+ <p class="submit"><input type="submit" value="Add Pet"/></p>
+ </c:when>
+ <c:otherwise>
+ <p class="submit"><input type="submit" value="Update Pet"/></p>
+ </c:otherwise>
+ </c:choose>
+ </td>
+ </tr>
+ </table>
+ </form:form>
+
+ <c:if test="${!pet['new']}">
+ <form:form method="delete">
+ <p class="submit"><input type="submit" value="Delete Pet"/></p>
+ </form:form>
+ </c:if>
+
+ </div>
+ <jsp:include page="../footer.jsp"/>
+</body>
+
+</html>
src/main/webapp/WEB-INF/jsp/pets/visitForm.jsp 143(+80 -63)
diff --git a/src/main/webapp/WEB-INF/jsp/pets/visitForm.jsp b/src/main/webapp/WEB-INF/jsp/pets/visitForm.jsp
index 97183f4..08dda8e 100644
--- a/src/main/webapp/WEB-INF/jsp/pets/visitForm.jsp
+++ b/src/main/webapp/WEB-INF/jsp/pets/visitForm.jsp
@@ -1,68 +1,85 @@
-<%@ include file="/WEB-INF/jsp/includes.jsp" %>
-<%@ include file="/WEB-INF/jsp/header.jsp" %>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<h2><c:if test="${visit['new']}">New </c:if>Visit:</h2>
-<form:form modelAttribute="visit">
- <b>Pet:</b>
- <table width="333">
- <thead>
- <th>Name</th>
- <th>Birth Date</th>
- <th>Type</th>
- <th>Owner</th>
- </thead>
- <tr>
- <td>${visit.pet.name}</td>
- <td><fmt:formatDate value="${visit.pet.birthDate}" pattern="yyyy-MM-dd"/></td>
- <td>${visit.pet.type.name}</td>
- <td>${visit.pet.owner.firstName} ${visit.pet.owner.lastName}</td>
- </tr>
- </table>
+<html lang="en">
- <table width="333">
- <tr>
- <th>
- Date:
- <br/><form:errors path="date" cssClass="errors"/>
- </th>
- <td>
- <form:input path="date" size="10" maxlength="10"/> (yyyy-mm-dd)
- </td>
- <tr/>
- <tr>
- <th valign="top">
- Description:
- <br/><form:errors path="description" cssClass="errors"/>
- </th>
- <td>
- <form:textarea path="description" rows="10" cols="25"/>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <input type="hidden" name="petId" value="${visit.pet.id}"/>
- <p class="submit"><input type="submit" value="Add Visit"/></p>
- </td>
- </tr>
- </table>
-</form:form>
+<jsp:include page="../header.jsp"/>
-<br/>
-<b>Previous Visits:</b>
-<table width="333">
- <tr>
- <th>Date</th>
- <th>Description</th>
- </tr>
- <c:forEach var="visit" items="${visit.pet.visits}">
- <c:if test="${!visit['new']}">
- <tr>
- <td><fmt:formatDate value="${visit.date}" pattern="yyyy-MM-dd"/></td>
- <td>${visit.description}</td>
- </tr>
- </c:if>
- </c:forEach>
-</table>
+<body>
-<%@ include file="/WEB-INF/jsp/footer.jsp" %>
+ <div id="main">
+
+ <h2><c:if test="${visit['new']}">New </c:if>Visit:</h2>
+
+ <form:form modelAttribute="visit">
+ <b>Pet:</b>
+ <table width="333">
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Birth Date</th>
+ <th>Type</th>
+ <th>Owner</th>
+ </tr>
+ </thead>
+ <tr>
+ <td>${visit.pet.name}</td>
+ <td><fmt:formatDate value="${visit.pet.birthDate}" pattern="yyyy-MM-dd"/></td>
+ <td>${visit.pet.type.name}</td>
+ <td>${visit.pet.owner.firstName} ${visit.pet.owner.lastName}</td>
+ </tr>
+ </table>
+
+ <table width="333">
+ <tr>
+ <th>
+ Date:
+ <br/><form:errors path="date" cssClass="errors"/>
+ </th>
+ <td>
+ <form:input path="date" size="10" maxlength="10"/> (yyyy-mm-dd)
+ </td>
+ <tr/>
+ <tr>
+ <th valign="top">
+ Description:
+ <br/><form:errors path="description" cssClass="errors"/>
+ </th>
+ <td>
+ <form:textarea path="description" rows="10" cols="25"/>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <input type="hidden" name="petId" value="${visit.pet.id}"/>
+ <p class="submit"><input type="submit" value="Add Visit"/></p>
+ </td>
+ </tr>
+ </table>
+ </form:form>
+
+ <br/>
+ <b>Previous Visits:</b>
+ <table width="333">
+ <tr>
+ <th>Date</th>
+ <th>Description</th>
+ </tr>
+ <c:forEach var="visit" items="${visit.pet.visits}">
+ <c:if test="${!visit['new']}">
+ <tr>
+ <td><fmt:formatDate value="${visit.date}" pattern="yyyy-MM-dd"/></td>
+ <td>${visit.description}</td>
+ </tr>
+ </c:if>
+ </c:forEach>
+ </table>
+
+ </div>
+ <jsp:include page="../footer.jsp"/>
+</body>
+
+</html>
src/main/webapp/WEB-INF/jsp/uncaughtException.jsp 103(+59 -44)
diff --git a/src/main/webapp/WEB-INF/jsp/uncaughtException.jsp b/src/main/webapp/WEB-INF/jsp/uncaughtException.jsp
index e97fdf3..236a7b9 100644
--- a/src/main/webapp/WEB-INF/jsp/uncaughtException.jsp
+++ b/src/main/webapp/WEB-INF/jsp/uncaughtException.jsp
@@ -1,49 +1,64 @@
-<%@ include file="/WEB-INF/jsp/includes.jsp" %>
-<%@ include file="/WEB-INF/jsp/header.jsp" %>
-
-<h2/>Internal error</h2>
-<p/>
-
-<%
-try {
- // The Servlet spec guarantees this attribute will be available
- Throwable exception = (Throwable) request.getAttribute("javax.servlet.error.exception");
-
- if (exception != null) {
- if (exception instanceof ServletException) {
- // It's a ServletException: we should extract the root cause
- ServletException sex = (ServletException) exception;
- Throwable rootCause = sex.getRootCause();
- if (rootCause == null)
- rootCause = sex;
- out.println("** Root cause is: "+ rootCause.getMessage());
- rootCause.printStackTrace(new java.io.PrintWriter(out));
- }
- else {
- // It's not a ServletException, so we'll just show it
- exception.printStackTrace(new java.io.PrintWriter(out));
- }
- }
- else {
- out.println("No error information available");
- }
-
- // Display cookies
- out.println("\nCookies:\n");
- Cookie[] cookies = request.getCookies();
- if (cookies != null) {
- for (int i = 0; i < cookies.length; i++) {
- out.println(cookies[i].getName() + "=[" + cookies[i].getValue() + "]");
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<html lang="en">
+
+<jsp:include page="header.jsp"/>
+
+<body>
+
+ <div id="main">
+
+ <h2>Internal error</h2>
+ <p/>
+
+ <%
+ try {
+ // The Servlet spec guarantees this attribute will be available
+ Throwable exception = (Throwable) request.getAttribute("javax.servlet.error.exception");
+
+ if (exception != null) {
+ if (exception instanceof ServletException) {
+ // It's a ServletException: we should extract the root cause
+ ServletException sex = (ServletException) exception;
+ Throwable rootCause = sex.getRootCause();
+ if (rootCause == null)
+ rootCause = sex;
+ out.println("** Root cause is: "+ rootCause.getMessage());
+ rootCause.printStackTrace(new java.io.PrintWriter(out));
+ }
+ else {
+ // It's not a ServletException, so we'll just show it
+ exception.printStackTrace(new java.io.PrintWriter(out));
+ }
+ }
+ else {
+ out.println("No error information available");
+ }
+
+ // Display cookies
+ out.println("\nCookies:\n");
+ Cookie[] cookies = request.getCookies();
+ if (cookies != null) {
+ for (int i = 0; i < cookies.length; i++) {
+ out.println(cookies[i].getName() + "=[" + cookies[i].getValue() + "]");
+ }
}
+
+ } catch (Exception ex) {
+ ex.printStackTrace(new java.io.PrintWriter(out));
}
-
-} catch (Exception ex) {
- ex.printStackTrace(new java.io.PrintWriter(out));
-}
-%>
+ %>
+
+ <p/>
+ <br/>
+
-<p/>
-<br/>
+ </div>
+ <jsp:include page="footer.jsp"/>
+</body>
-<%@ include file="/WEB-INF/jsp/footer.jsp" %>
+</html>
src/main/webapp/WEB-INF/jsp/vets.jsp 80(+49 -31)
diff --git a/src/main/webapp/WEB-INF/jsp/vets.jsp b/src/main/webapp/WEB-INF/jsp/vets.jsp
index cff2154..81f3fdf 100644
--- a/src/main/webapp/WEB-INF/jsp/vets.jsp
+++ b/src/main/webapp/WEB-INF/jsp/vets.jsp
@@ -1,31 +1,49 @@
-<%@ include file="/WEB-INF/jsp/includes.jsp" %>
-<%@ include file="/WEB-INF/jsp/header.jsp" %>
-
-<h2>Veterinarians:</h2>
-
-<table>
- <thead>
- <th>Name</th>
- <th>Specialties</th>
- </thead>
- <c:forEach var="vet" items="${vets.vetList}">
- <tr>
- <td>${vet.firstName} ${vet.lastName}</td>
- <td>
- <c:forEach var="specialty" items="${vet.specialties}">
- ${specialty.name}
- </c:forEach>
- <c:if test="${vet.nrOfSpecialties == 0}">none</c:if>
- </td>
- </tr>
- </c:forEach>
-</table>
-<table class="table-buttons">
- <tr>
- <td>
- <a href="<spring:url value="/vets.xml" htmlEscape="true" />">View as XML</a>
- </td>
- </tr>
-</table>
-
-<%@ include file="/WEB-INF/jsp/footer.jsp" %>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+
+<html lang="en">
+
+<jsp:include page="header.jsp"/>
+
+<body>
+
+ <div id="main">
+
+ <h2>Veterinarians:</h2>
+
+ <table>
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Specialties</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach var="vet" items="${vets.vetList}">
+ <tr>
+ <td>${vet.firstName} ${vet.lastName}</td>
+ <td>
+ <c:forEach var="specialty" items="${vet.specialties}">
+ ${specialty.name}
+ </c:forEach>
+ <c:if test="${vet.nrOfSpecialties == 0}">none</c:if>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ <table class="table-buttons">
+ <tr>
+ <td>
+ <a href="<spring:url value="/vets.xml" htmlEscape="true" />">View as XML</a>
+ </td>
+ </tr>
+ </table>
+
+ </div>
+ <jsp:include page="footer.jsp"/>
+</body>
+
+</html>
src/main/webapp/WEB-INF/jsp/welcome.jsp 34(+17 -17)
diff --git a/src/main/webapp/WEB-INF/jsp/welcome.jsp b/src/main/webapp/WEB-INF/jsp/welcome.jsp
index 9b431e4..9cddcd6 100644
--- a/src/main/webapp/WEB-INF/jsp/welcome.jsp
+++ b/src/main/webapp/WEB-INF/jsp/welcome.jsp
@@ -2,28 +2,28 @@
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<html lang="en">
<jsp:include page="header.jsp"/>
<body>
- <div id="main">
-<img src="<spring:url value="/resources/images/pets.png" htmlEscape="true" />" align="right" style="position:relative;right:30px;"></img>
-<h2><fmt:message key="welcome"/></h2>
-
-<ul>
- <li><a href="<spring:url value="/owners/search" htmlEscape="true" />">Find owner</a></li>
- <li><a href="<spring:url value="/vets" htmlEscape="true" />">Display all veterinarians</a></li>
- <li><a href="<spring:url value="/resources/html/tutorial.html" htmlEscape="true" />">Tutorial</a></li>
-</ul>
-
-<p> </p>
-<p> </p>
-
-<jsp:include page="footer.jsp"/>
-
- </div>
+ <div id="main">
+ <img src="<spring:url value="/resources/images/pets.png" htmlEscape="true" />" align="right" style="position:relative;right:30px;"></img>
+ <h2><fmt:message key="welcome"/></h2>
+
+ <ul>
+ <li><a href="<spring:url value="/owners/search" htmlEscape="true" />">Find owner</a></li>
+ <li><a href="<spring:url value="/vets" htmlEscape="true" />">Display all veterinarians</a></li>
+ <li><a href="<spring:url value="/resources/html/tutorial.html" htmlEscape="true" />">Tutorial</a></li>
+ </ul>
+
+ <p> </p>
+ <p> </p>
+
+
+ </div>
+ <jsp:include page="footer.jsp"/>
</body>
</html>
diff --git a/src/main/webapp/WEB-INF/spring/applicationContext-jdbc.xml b/src/main/webapp/WEB-INF/spring/applicationContext-jdbc.xml
index 6819d6d..a45edac 100644
--- a/src/main/webapp/WEB-INF/spring/applicationContext-jdbc.xml
+++ b/src/main/webapp/WEB-INF/spring/applicationContext-jdbc.xml
@@ -52,7 +52,7 @@
<!--
Exporter that exposes the Clinic DAO and the CallMonitoringAspect via JMX,
based on the @ManagedResource, @ManagedAttribute, and @ManagedOperation annotations.
- -->
+ -->
<context:mbean-export/>
<!-- PetClinic's central data access object using Spring's SimpleJdbcTemplate -->