removed static inclusion of jsp

This commit is contained in:
Mic 2013-01-09 21:23:44 +08:00
parent 6dd1acd4b1
commit c690c9d05c
11 changed files with 518 additions and 413 deletions

View file

@ -1,19 +1,30 @@
<%@ include file="/WEB-INF/jsp/includes.jsp" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>
<%
Exception ex = (Exception) request.getAttribute("exception");
%>
<h2>Data access failure: <%= ex.getMessage() %></h2> <html lang="en">
<p/>
<% <jsp:include page="header.jsp"/>
ex.printStackTrace(new java.io.PrintWriter(out));
%>
<p/> <body>
<br/> <div id="main">
<a href="<spring:url value="/" htmlEscape="true" />">Home</a> <%
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>

View file

@ -1,5 +0,0 @@
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

View file

@ -1,61 +1,77 @@
<%@ include file="/WEB-INF/jsp/includes.jsp" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:choose> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:when test="${owner['new']}"><c:set var="method" value="post"/></c:when> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:otherwise><c:set var="method" value="put"/></c:otherwise> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
</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>
<%@ 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>

View file

@ -1,34 +1,51 @@
<%@ include file="/WEB-INF/jsp/includes.jsp" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %> <%@ 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> <h2>Owners:</h2>
<table> <table>
<thead> <thead>
<th>Name</th> <tr>
<th>Address</th> <th>Name</th>
<th>City</th> <th>Address</th>
<th>Telephone</th> <th>City</th>
<th>Pets</th> <th>Telephone</th>
</thead> <th>Pets</th>
<c:forEach var="owner" items="${selections}"> </tr>
<tr> </thead>
<td> <c:forEach var="owner" items="${selections}">
<spring:url value="owners/{ownerId}" var="ownerUrl"> <tr>
<spring:param name="ownerId" value="${owner.id}"/> <td>
</spring:url> <spring:url value="owners/{ownerId}" var="ownerUrl">
<a href="${fn:escapeXml(ownerUrl)}">${owner.firstName} ${owner.lastName}</a> <spring:param name="ownerId" value="${owner.id}"/>
</td> </spring:url>
<td>${owner.address}</td> <a href="${fn:escapeXml(ownerUrl)}">${owner.firstName} ${owner.lastName}</a>
<td>${owner.city}</td> </td>
<td>${owner.telephone}</td> <td>${owner.address}</td>
<td> <td>${owner.city}</td>
<c:forEach var="pet" items="${owner.pets}"> <td>${owner.telephone}</td>
${pet.name} &nbsp; <td>
</c:forEach> <c:forEach var="pet" items="${owner.pets}">
</td> ${pet.name} &nbsp;
</tr> </c:forEach>
</c:forEach> </td>
</table> </tr>
</c:forEach>
</table>
<%@ include file="/WEB-INF/jsp/footer.jsp" %> </div>
<jsp:include page="../footer.jsp"/>
</body>
</html>

View file

@ -11,112 +11,114 @@
<div id="main"> <div id="main">
<h2>Owner Information</h2> <h2>Owner Information</h2>
<table> <table>
<tr> <tr>
<th>Name</th> <th>Name</th>
<td><b>${owner.firstName} ${owner.lastName}</b></td> <td><b>${owner.firstName} ${owner.lastName}</b></td>
</tr> </tr>
<tr> <tr>
<th>Address</th> <th>Address</th>
<td>${owner.address}</td> <td>${owner.address}</td>
</tr> </tr>
<tr> <tr>
<th>City</th> <th>City</th>
<td>${owner.city}</td> <td>${owner.city}</td>
</tr> </tr>
<tr> <tr>
<th>Telephone </th> <th>Telephone </th>
<td>${owner.telephone}</td> <td>${owner.telephone}</td>
</tr> </tr>
</table> </table>
<table class="table-buttons"> <table class="table-buttons">
<tr> <tr>
<td colspan="2" align="center"> <td colspan="2" align="center">
<spring:url value="{ownerId}/edit" var="editUrl"> <spring:url value="{ownerId}/edit" var="editUrl">
<spring:param name="ownerId" value="${owner.id}" /> <spring:param name="ownerId" value="${owner.id}" />
</spring:url> </spring:url>
<a href="${fn:escapeXml(editUrl)}">Edit Owner</a> <a href="${fn:escapeXml(editUrl)}">Edit Owner</a>
</td> </td>
<td> <td>
<spring:url value="{ownerId}/pets/new" var="addUrl"> <spring:url value="{ownerId}/pets/new" var="addUrl">
<spring:param name="ownerId" value="${owner.id}" /> <spring:param name="ownerId" value="${owner.id}" />
</spring:url> </spring:url>
<a href="${fn:escapeXml(addUrl)}">Add New Pet</a> <a href="${fn:escapeXml(addUrl)}">Add New Pet</a>
</td> </td>
</tr> </tr>
</table> </table>
<h2>Pets and Visits</h2> <h2>Pets and Visits</h2>
<c:forEach var="pet" items="${owner.pets}"> <c:forEach var="pet" items="${owner.pets}">
<table width="94%"> <table width="94%">
<tr> <tr>
<td valign="top"> <td valign="top">
<table> <table>
<tr> <tr>
<th>Name</th> <th>Name</th>
<td><b>${pet.name}</b></td> <td><b>${pet.name}</b></td>
</tr> </tr>
<tr> <tr>
<th>Birth Date</th> <th>Birth Date</th>
<td><fmt:formatDate value="${pet.birthDate}" pattern="yyyy-MM-dd"/></td> <td><fmt:formatDate value="${pet.birthDate}" pattern="yyyy-MM-dd"/></td>
</tr> </tr>
<tr> <tr>
<th>Type</th> <th>Type</th>
<td>${pet.type.name}</td> <td>${pet.type.name}</td>
</tr> </tr>
</table> </table>
</td> </td>
<td valign="top"> <td valign="top">
<table> <table>
<thead> <thead>
<th>Visit Date</th> <tr>
<th>Description</th> <th>Visit Date</th>
</thead> <th>Description</th>
<c:forEach var="visit" items="${pet.visits}"> </tr>
<tr> </thead>
<td><fmt:formatDate value="${visit.date}" pattern="yyyy-MM-dd"/></td> <c:forEach var="visit" items="${pet.visits}">
<td>${visit.description}</td> <tr>
</tr> <td><fmt:formatDate value="${visit.date}" pattern="yyyy-MM-dd"/></td>
</c:forEach> <td>${visit.description}</td>
</table> </tr>
</td> </c:forEach>
</tr> </table>
</table> </td>
<table class="table-buttons"> </tr>
<tr> </table>
<td> <table class="table-buttons">
<spring:url value="{ownerId}/pets/{petId}/edit" var="petUrl"> <tr>
<spring:param name="ownerId" value="${owner.id}"/> <td>
<spring:param name="petId" value="${pet.id}"/> <spring:url value="{ownerId}/pets/{petId}/edit" var="petUrl">
</spring:url> <spring:param name="ownerId" value="${owner.id}"/>
<a href="${fn:escapeXml(petUrl)}">Edit Pet</a> <spring:param name="petId" value="${pet.id}"/>
</td> </spring:url>
<td></td> <a href="${fn:escapeXml(petUrl)}">Edit Pet</a>
<td> </td>
<spring:url value="{ownerId}/pets/{petId}/visits/new" var="visitUrl"> <td></td>
<spring:param name="ownerId" value="${owner.id}"/> <td>
<spring:param name="petId" value="${pet.id}"/> <spring:url value="{ownerId}/pets/{petId}/visits/new" var="visitUrl">
</spring:url> <spring:param name="ownerId" value="${owner.id}"/>
<a href="${fn:escapeXml(visitUrl)}">Add Visit</a> <spring:param name="petId" value="${pet.id}"/>
</td> </spring:url>
<td></td> <a href="${fn:escapeXml(visitUrl)}">Add Visit</a>
<td> </td>
<spring:url value="{ownerId}/pets/{petId}/visits.atom" var="feedUrl"> <td></td>
<spring:param name="ownerId" value="${owner.id}"/> <td>
<spring:param name="petId" value="${pet.id}"/> <spring:url value="{ownerId}/pets/{petId}/visits.atom" var="feedUrl">
</spring:url> <spring:param name="ownerId" value="${owner.id}"/>
<a href="${fn:escapeXml(feedUrl)}" rel="alternate" type="application/atom+xml">Atom Feed</a> <spring:param name="petId" value="${pet.id}"/>
</td> </spring:url>
</tr> <a href="${fn:escapeXml(feedUrl)}" rel="alternate" type="application/atom+xml">Atom Feed</a>
</table> </td>
</c:forEach> </tr>
</table>
</c:forEach>
<jsp:include page="../footer.jsp"/> </div>
</div> <jsp:include page="../footer.jsp"/>
</body> </body>
</html> </html>

View file

@ -1,56 +1,70 @@
<%@ include file="/WEB-INF/jsp/includes.jsp" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:choose> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<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} <html lang="en">
<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']}"> <jsp:include page="../header.jsp"/>
<form:form method="delete">
<p class="submit"><input type="submit" value="Delete Pet"/></p>
</form:form>
</c:if>
<%@ 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>

View file

@ -1,68 +1,85 @@
<%@ include file="/WEB-INF/jsp/includes.jsp" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %> <%@ 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"> <html lang="en">
<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>
<table width="333"> <jsp:include page="../header.jsp"/>
<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/> <body>
<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>
<%@ 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>

View file

@ -1,49 +1,64 @@
<%@ include file="/WEB-INF/jsp/includes.jsp" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %> <%@ 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" %>
<h2/>Internal error</h2> <html lang="en">
<p/>
<% <jsp:include page="header.jsp"/>
try {
// The Servlet spec guarantees this attribute will be available
Throwable exception = (Throwable) request.getAttribute("javax.servlet.error.exception");
if (exception != null) { <body>
if (exception instanceof ServletException) {
// It's a ServletException: we should extract the root cause <div id="main">
ServletException sex = (ServletException) exception;
Throwable rootCause = sex.getRootCause(); <h2>Internal error</h2>
if (rootCause == null) <p/>
rootCause = sex;
out.println("** Root cause is: "+ rootCause.getMessage()); <%
rootCause.printStackTrace(new java.io.PrintWriter(out)); try {
} // The Servlet spec guarantees this attribute will be available
else { Throwable exception = (Throwable) request.getAttribute("javax.servlet.error.exception");
// It's not a ServletException, so we'll just show it
exception.printStackTrace(new java.io.PrintWriter(out)); if (exception != null) {
} if (exception instanceof ServletException) {
} // It's a ServletException: we should extract the root cause
else { ServletException sex = (ServletException) exception;
out.println("No error information available"); Throwable rootCause = sex.getRootCause();
} if (rootCause == null)
rootCause = sex;
// Display cookies out.println("** Root cause is: "+ rootCause.getMessage());
out.println("\nCookies:\n"); rootCause.printStackTrace(new java.io.PrintWriter(out));
Cookie[] cookies = request.getCookies(); }
if (cookies != null) { else {
for (int i = 0; i < cookies.length; i++) { // It's not a ServletException, so we'll just show it
out.println(cookies[i].getName() + "=[" + cookies[i].getValue() + "]"); 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/> <p/>
<br/> <br/>
<%@ include file="/WEB-INF/jsp/footer.jsp" %> </div>
<jsp:include page="footer.jsp"/>
</body>
</html>

View file

@ -1,31 +1,49 @@
<%@ include file="/WEB-INF/jsp/includes.jsp" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<h2>Veterinarians:</h2>
<table> <html lang="en">
<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" %> <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>

View file

@ -2,28 +2,28 @@
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ 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"/> <jsp:include page="header.jsp"/>
<body> <body>
<div id="main"> <div id="main">
<img src="<spring:url value="/resources/images/pets.png" htmlEscape="true" />" align="right" style="position:relative;right:30px;"></img> <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> <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>&nbsp;</p>
<p>&nbsp;</p>
<ul> </div>
<li><a href="<spring:url value="/owners/search" htmlEscape="true" />">Find owner</a></li> <jsp:include page="footer.jsp"/>
<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>&nbsp;</p>
<p>&nbsp;</p>
<jsp:include page="footer.jsp"/>
</div>
</body> </body>
</html> </html>

View file

@ -52,7 +52,7 @@
<!-- <!--
Exporter that exposes the Clinic DAO and the CallMonitoringAspect via JMX, Exporter that exposes the Clinic DAO and the CallMonitoringAspect via JMX,
based on the @ManagedResource, @ManagedAttribute, and @ManagedOperation annotations. based on the @ManagedResource, @ManagedAttribute, and @ManagedOperation annotations.
--> -->
<context:mbean-export/> <context:mbean-export/>
<!-- PetClinic's central data access object using Spring's SimpleJdbcTemplate --> <!-- PetClinic's central data access object using Spring's SimpleJdbcTemplate -->