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" %>
<%@ 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");
%>
<%@ 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" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>
<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" %>
<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>
</c:choose>
<h2><c:if test="${owner['new']}">New </c:if>Owner:</h2>
<form:form modelAttribute="owner" method="${method}">
<h2><c:if test="${owner['new']}">New </c:if>Owner:</h2>
<form:form modelAttribute="owner" method="${method}">
<table>
<tr>
<th>
@ -56,6 +68,10 @@
</td>
</tr>
</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" %>
<%@ 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>
<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>
@ -29,6 +42,10 @@
</td>
</tr>
</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">
<h2>Owner Information</h2>
<h2>Owner Information</h2>
<table>
<tr>
@ -72,8 +72,10 @@
<td valign="top">
<table>
<thead>
<tr>
<th>Visit Date</th>
<th>Description</th>
</tr>
</thead>
<c:forEach var="visit" items="${pet.visits}">
<tr>
@ -114,9 +116,9 @@
</table>
</c:forEach>
<jsp:include page="../footer.jsp"/>
</div>
<jsp:include page="../footer.jsp"/>
</body>
</html>

View file

@ -1,15 +1,25 @@
<%@ include file="/WEB-INF/jsp/includes.jsp" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>
<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" %>
<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: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}
<br/>
<form:form modelAttribute="pet" method="${method}">
<b>Owner:</b> ${pet.owner.firstName} ${pet.owner.lastName}
<br/>
<form:form modelAttribute="pet" method="${method}">
<table>
<tr>
<th>
@ -45,12 +55,16 @@
</td>
</tr>
</table>
</form:form>
</form:form>
<c:if test="${!pet['new']}">
<c:if test="${!pet['new']}">
<form:form method="delete">
<p class="submit"><input type="submit" value="Delete Pet"/></p>
</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" %>
<%@ 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">
<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>
<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>
@ -46,11 +59,11 @@
</td>
</tr>
</table>
</form:form>
</form:form>
<br/>
<b>Previous Visits:</b>
<table width="333">
<br/>
<b>Previous Visits:</b>
<table width="333">
<tr>
<th>Date</th>
<th>Description</th>
@ -63,6 +76,10 @@
</tr>
</c:if>
</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" %>
<%@ 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="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<h2/>Internal error</h2>
<p/>
<html lang="en">
<%
try {
<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");
@ -37,13 +47,18 @@ try {
}
}
} catch (Exception ex) {
} catch (Exception ex) {
ex.printStackTrace(new java.io.PrintWriter(out));
}
%>
}
%>
<p/>
<br/>
<p/>
<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" %>
<%@ 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" %>
<h2>Veterinarians:</h2>
<table>
<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>
@ -19,13 +32,18 @@
</td>
</tr>
</c:forEach>
</table>
<table class="table-buttons">
</tbody>
</table>
<table class="table-buttons">
<tr>
<td>
<a href="<spring:url value="/vets.xml" htmlEscape="true" />">View as XML</a>
</td>
</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" %>
<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>
<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>
<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>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<jsp:include page="footer.jsp"/>
</div>
<jsp:include page="footer.jsp"/>
</body>
</html>