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");
%>
<%@ include file="/WEB-INF/jsp/footer.jsp" %> <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"/>
</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,12 +1,24 @@
<%@ 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" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<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:when test="${owner['new']}"><c:set var="method" value="post"/></c:when>
<c:otherwise><c:set var="method" value="put"/></c:otherwise> <c:otherwise><c:set var="method" value="put"/></c:otherwise>
</c:choose> </c:choose>
<h2><c:if test="${owner['new']}">New </c:if>Owner:</h2> <h2><c:if test="${owner['new']}">New </c:if>Owner:</h2>
<form:form modelAttribute="owner" method="${method}"> <form:form modelAttribute="owner" method="${method}">
<table> <table>
<tr> <tr>
<th> <th>
@ -56,6 +68,10 @@
</td> </td>
</tr> </tr>
</table> </table>
</form:form> </form:form>
<%@ include file="/WEB-INF/jsp/footer.jsp" %> </div>
<jsp:include page="../footer.jsp"/>
</body>
</html>

View file

@ -1,15 +1,28 @@
<%@ 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>
<tr>
<th>Name</th> <th>Name</th>
<th>Address</th> <th>Address</th>
<th>City</th> <th>City</th>
<th>Telephone</th> <th>Telephone</th>
<th>Pets</th> <th>Pets</th>
</tr>
</thead> </thead>
<c:forEach var="owner" items="${selections}"> <c:forEach var="owner" items="${selections}">
<tr> <tr>
@ -29,6 +42,10 @@
</td> </td>
</tr> </tr>
</c:forEach> </c:forEach>
</table> </table>
<%@ include file="/WEB-INF/jsp/footer.jsp" %> </div>
<jsp:include page="../footer.jsp"/>
</body>
</html>

View file

@ -11,7 +11,7 @@
<div id="main"> <div id="main">
<h2>Owner Information</h2> <h2>Owner Information</h2>
<table> <table>
<tr> <tr>
@ -72,8 +72,10 @@
<td valign="top"> <td valign="top">
<table> <table>
<thead> <thead>
<tr>
<th>Visit Date</th> <th>Visit Date</th>
<th>Description</th> <th>Description</th>
</tr>
</thead> </thead>
<c:forEach var="visit" items="${pet.visits}"> <c:forEach var="visit" items="${pet.visits}">
<tr> <tr>
@ -114,9 +116,9 @@
</table> </table>
</c:forEach> </c:forEach>
<jsp:include page="../footer.jsp"/>
</div> </div>
<jsp:include page="../footer.jsp"/>
</body> </body>
</html> </html>

View file

@ -1,15 +1,25 @@
<%@ 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" %>
<html lang="en">
<jsp:include page="../header.jsp"/>
<body>
<div id="main">
<c:choose>
<c:when test="${pet['new']}"><c:set var="method" value="post"/></c:when> <c:when test="${pet['new']}"><c:set var="method" value="post"/></c:when>
<c:otherwise><c:set var="method" value="put"/></c:otherwise> <c:otherwise><c:set var="method" value="put"/></c:otherwise>
</c:choose> </c:choose>
<h2><c:if test="${pet['new']}">New </c:if>Pet</h2> <h2><c:if test="${pet['new']}">New </c:if>Pet</h2>
<b>Owner:</b> ${pet.owner.firstName} ${pet.owner.lastName} <b>Owner:</b> ${pet.owner.firstName} ${pet.owner.lastName}
<br/> <br/>
<form:form modelAttribute="pet" method="${method}"> <form:form modelAttribute="pet" method="${method}">
<table> <table>
<tr> <tr>
<th> <th>
@ -45,12 +55,16 @@
</td> </td>
</tr> </tr>
</table> </table>
</form:form> </form:form>
<c:if test="${!pet['new']}"> <c:if test="${!pet['new']}">
<form:form method="delete"> <form:form method="delete">
<p class="submit"><input type="submit" value="Delete Pet"/></p> <p class="submit"><input type="submit" value="Delete Pet"/></p>
</form:form> </form:form>
</c:if> </c:if>
<%@ include file="/WEB-INF/jsp/footer.jsp" %> </div>
<jsp:include page="../footer.jsp"/>
</body>
</html>

View file

@ -1,16 +1,29 @@
<%@ 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">
<jsp:include page="../header.jsp"/>
<body>
<div id="main">
<h2><c:if test="${visit['new']}">New </c:if>Visit:</h2>
<form:form modelAttribute="visit">
<b>Pet:</b> <b>Pet:</b>
<table width="333"> <table width="333">
<thead> <thead>
<tr>
<th>Name</th> <th>Name</th>
<th>Birth Date</th> <th>Birth Date</th>
<th>Type</th> <th>Type</th>
<th>Owner</th> <th>Owner</th>
</tr>
</thead> </thead>
<tr> <tr>
<td>${visit.pet.name}</td> <td>${visit.pet.name}</td>
@ -46,11 +59,11 @@
</td> </td>
</tr> </tr>
</table> </table>
</form:form> </form:form>
<br/> <br/>
<b>Previous Visits:</b> <b>Previous Visits:</b>
<table width="333"> <table width="333">
<tr> <tr>
<th>Date</th> <th>Date</th>
<th>Description</th> <th>Description</th>
@ -63,6 +76,10 @@
</tr> </tr>
</c:if> </c:if>
</c:forEach> </c:forEach>
</table> </table>
<%@ include file="/WEB-INF/jsp/footer.jsp" %> </div>
<jsp:include page="../footer.jsp"/>
</body>
</html>

View file

@ -1,11 +1,21 @@
<%@ 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 {
<body>
<div id="main">
<h2>Internal error</h2>
<p/>
<%
try {
// The Servlet spec guarantees this attribute will be available // The Servlet spec guarantees this attribute will be available
Throwable exception = (Throwable) request.getAttribute("javax.servlet.error.exception"); Throwable exception = (Throwable) request.getAttribute("javax.servlet.error.exception");
@ -37,13 +47,18 @@ try {
} }
} }
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(new java.io.PrintWriter(out)); 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,13 +1,26 @@
<%@ 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">
<jsp:include page="header.jsp"/>
<body>
<div id="main">
<h2>Veterinarians:</h2>
<table>
<thead> <thead>
<tr>
<th>Name</th> <th>Name</th>
<th>Specialties</th> <th>Specialties</th>
</tr>
</thead> </thead>
<tbody>
<c:forEach var="vet" items="${vets.vetList}"> <c:forEach var="vet" items="${vets.vetList}">
<tr> <tr>
<td>${vet.firstName} ${vet.lastName}</td> <td>${vet.firstName} ${vet.lastName}</td>
@ -19,13 +32,18 @@
</td> </td>
</tr> </tr>
</c:forEach> </c:forEach>
</table> </tbody>
<table class="table-buttons"> </table>
<table class="table-buttons">
<tr> <tr>
<td> <td>
<a href="<spring:url value="/vets.xml" htmlEscape="true" />">View as XML</a> <a href="<spring:url value="/vets.xml" htmlEscape="true" />">View as XML</a>
</td> </td>
</tr> </tr>
</table> </table>
<%@ include file="/WEB-INF/jsp/footer.jsp" %> </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> <ul>
<li><a href="<spring:url value="/owners/search" htmlEscape="true" />">Find owner</a></li> <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="/vets" htmlEscape="true" />">Display all veterinarians</a></li>
<li><a href="<spring:url value="/resources/html/tutorial.html" htmlEscape="true" />">Tutorial</a></li> <li><a href="<spring:url value="/resources/html/tutorial.html" htmlEscape="true" />">Tutorial</a></li>
</ul> </ul>
<p>&nbsp;</p> <p>&nbsp;</p>
<p>&nbsp;</p> <p>&nbsp;</p>
<jsp:include page="footer.jsp"/>
</div> </div>
<jsp:include page="footer.jsp"/>
</body> </body>
</html> </html>