Petclinic is RESTful.
This commit is contained in:
@@ -14,6 +14,6 @@ ex.printStackTrace(new java.io.PrintWriter(out));
|
||||
|
||||
<p/>
|
||||
<br/>
|
||||
<a href="<c:url value="/welcome.do"/>">Home</a>
|
||||
<a href="<spring:url value="/welcome.do"/>">Home</a>
|
||||
|
||||
<%@ include file="/WEB-INF/jsp/footer.jsp" %>
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
|
||||
<h2>Find Owners:</h2>
|
||||
|
||||
<form:form modelAttribute="owner">
|
||||
<spring:url value="/clinic/owners" var="formUrl"/>
|
||||
<form:form modelAttribute="owner" action="${formUrl}" method="GET">
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Last Name: <form:errors path="*" cssClass="errors"/>
|
||||
<br/>
|
||||
<form:input path="lastName" size="30" maxlength="80"/>
|
||||
<form:input path="lastName" size="30" maxlength="80" />
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -19,6 +20,6 @@
|
||||
</form:form>
|
||||
|
||||
<br/>
|
||||
<a href="<c:url value="/addOwner.do"/>">Add Owner</a>
|
||||
<a href='<spring:url value="/clinic/owners/new"/>'>Add Owner</a>
|
||||
|
||||
<%@ include file="/WEB-INF/jsp/footer.jsp" %>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
<table class="footer">
|
||||
<tr>
|
||||
<td><a href="<c:url value="/welcome.do"/>">Home</a></td>
|
||||
<td align="right"><img src="<c:url value="/images/springsource-logo.png"/>"/></td>
|
||||
<td><a href="<spring:url value="/clinic/welcome"/>">Home</a></td>
|
||||
<td align="right"><img src="<spring:url value="/images/springsource-logo.png"/>" alt="Sponsored by SpringSource"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<link rel="stylesheet" href="<c:url value="/styles/petclinic.css"/>" type="text/css"/>
|
||||
<link rel="stylesheet" href="<spring:url value="/styles/petclinic.css"/>" type="text/css"/>
|
||||
<title>PetClinic :: a Spring Framework demonstration</title>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -24,16 +24,10 @@
|
||||
<table class="table-buttons">
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<form method="GET" action="<c:url value="/editOwner.do"/>">
|
||||
<input type="hidden" name="ownerId" value="${owner.id}"/>
|
||||
<p class="submit"><input type="submit" value="Edit Owner"/></p>
|
||||
</form>
|
||||
<a href="<spring:url value="${owner.id}/edit"/>">Edit Owner</a>
|
||||
</td>
|
||||
<td>
|
||||
<form method="GET" action="<c:url value="/addPet.do"/>" name="formAddPet">
|
||||
<input type="hidden" name="ownerId" value="${owner.id}"/>
|
||||
<p class="submit"><input type="submit" value="Add New Pet"/></p>
|
||||
</form>
|
||||
<a href="<spring:url value="${owner.id}/pets/new"/>">Add New Pet</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -80,16 +74,17 @@
|
||||
<table class="table-buttons">
|
||||
<tr>
|
||||
<td>
|
||||
<form method="GET" action="<c:url value="/editPet.do"/>" name="formEditPet${pet.id}">
|
||||
<input type="hidden" name="petId" value="${pet.id}"/>
|
||||
<p class="submit"><input type="submit" value="Edit Pet"/></p>
|
||||
</form>
|
||||
<spring:url value="${owner.id}/pets/{petId}" var="petUrl">
|
||||
<spring:param name="petId" value="${pet.id}"/>
|
||||
</spring:url>
|
||||
<a href="${petUrl}">Edit Pet</a>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<form method="GET" action="<c:url value="/addVisit.do"/>" name="formVisitPet${pet.id}">
|
||||
<input type="hidden" name="petId" value="${pet.id}"/>
|
||||
<p class="submit"><input type="submit" value="Add Visit"/></p>
|
||||
</form>
|
||||
<spring:url value="${owner.id}/pets/{petId}/visits/new" var="visitUrl">
|
||||
<spring:param name="petId" value="${pet.id}"/>
|
||||
</spring:url>
|
||||
<a href="${visitUrl}">Add Visit</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -16,7 +16,10 @@
|
||||
<c:forEach var="owner" items="${selections}">
|
||||
<tr>
|
||||
<td>
|
||||
<a href="owner.do?ownerId=${owner.id}">${owner.firstName} ${owner.lastName}</a>
|
||||
<spring:url value="owners/{ownerId}" var="ownerUrl">
|
||||
<spring:param name="ownerId" value="${owner.id}"/>
|
||||
</spring:url>
|
||||
<a href="${ownerUrl}">${owner.firstName} ${owner.lastName}</a>
|
||||
</td>
|
||||
<td>${owner.address}</td>
|
||||
<td>${owner.city}</td>
|
||||
|
||||
@@ -44,4 +44,10 @@
|
||||
</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>
|
||||
|
||||
<%@ include file="/WEB-INF/jsp/footer.jsp" %>
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
<%@ include file="/WEB-INF/jsp/includes.jsp" %>
|
||||
<%@ include file="/WEB-INF/jsp/header.jsp" %>
|
||||
|
||||
<img src="images/pets.png" align="right" style="position:relative;right:30px;">
|
||||
<img src="<spring:url value="/images/pets.png"/>" align="right" style="position:relative;right:30px;">
|
||||
<h2><fmt:message key="welcome"/></h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="<c:url value="/findOwners.do"/>">Find owner</a></li>
|
||||
<li><a href="<c:url value="/vets.do"/>">Display all veterinarians</a></li>
|
||||
<li><a href="<c:url value="/html/petclinic.html"/>">Tutorial</a></li>
|
||||
<li><a href="<c:url value="/docs/index.html"/>">Documentation</a></li>
|
||||
<li><a href="<spring:url value="/clinic/owners/form"/>">Find owner</a></li>
|
||||
<li><a href="<spring:url value="/clinic/vets"/>">Display all veterinarians</a></li>
|
||||
<li><a href="<spring:url value="/html/petclinic.html"/>">Tutorial</a></li>
|
||||
</ul>
|
||||
|
||||
<p> </p>
|
||||
|
||||
@@ -110,9 +110,19 @@
|
||||
-->
|
||||
<servlet-mapping>
|
||||
<servlet-name>petclinic</servlet-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
<url-pattern>/clinic/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<filter>
|
||||
<filter-name>httpMethodFilter</filter-name>
|
||||
<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>httpMethodFilter</filter-name>
|
||||
<servlet-name>petclinic</servlet-name>
|
||||
</filter-mapping>
|
||||
|
||||
<session-config>
|
||||
<session-timeout>10</session-timeout>
|
||||
</session-config>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<%@ include file="/WEB-INF/jsp/includes.jsp" %>
|
||||
|
||||
<%-- Redirected because we can't set the welcome page to a virtual URL. --%>
|
||||
<c:redirect url="/welcome.do"/>
|
||||
<c:redirect url="/clinic/welcome"/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user