visitForm.jsp
上传用户:dezhong
上传日期:2022-08-10
资源大小:167k
文件大小:2k
源码类别:

Java编程

开发平台:

Java

  1. <%@ include file="/WEB-INF/jsp/includes.jsp" %>
  2. <%@ include file="/WEB-INF/jsp/header.jsp" %>
  3. <h2><c:if test="${visit.new}">New </c:if>Visit:</h2>
  4. <form:form modelAttribute="visit">
  5.   <b>Pet:</b>
  6.   <table width="333">
  7.     <tr>
  8.     <thead>
  9.       <th>Name</th>
  10.       <th>Birth Date</th>
  11.       <th>Type</th>
  12.       <th>Owner</th>
  13.     </thead>
  14.     </tr>
  15.     <tr>
  16.       <td>${visit.pet.name}</td>
  17.       <td><fmt:formatDate value="${visit.pet.birthDate}" pattern="yyyy-MM-dd"/></td>
  18.       <td>${visit.pet.type.name}</td>
  19.       <td>${visit.pet.owner.firstName} ${visit.pet.owner.lastName}</td>
  20.     </tr>
  21.   </table>
  22.   <table width="333">
  23.     <tr>
  24.       <th>
  25.         Date:
  26.         <br/><form:errors path="date" cssClass="errors"/>
  27.       </th>
  28.       <td>
  29.         <form:input path="date" size="10" maxlength="10"/> (yyyy-mm-dd)
  30.       </td>
  31.     <tr/>
  32.     <tr>
  33.       <th valign="top">
  34.         Description:
  35.         <br/><form:errors path="description" cssClass="errors"/>
  36.       </th>
  37.       <td>
  38.         <form:textarea path="description" rows="10" cols="25"/>
  39.       </td>
  40.     </tr>
  41.     <tr>
  42.       <td colspan="2">
  43.         <input type="hidden" name="petId" value="${visit.pet.id}"/>
  44.         <p class="submit"><input type="submit" value="Add Visit"/></p>
  45.       </td>
  46.     </tr>
  47.   </table>
  48. </form:form>
  49. <br/>
  50. <b>Previous Visits:</b>
  51. <table width="333">
  52.   <tr>
  53.     <th>Date</th>
  54.     <th>Description</th>
  55.   </tr>
  56.   <c:forEach var="visit" items="${visit.pet.visits}">
  57.     <c:if test="${!visit.new}">
  58.       <tr>
  59.         <td><fmt:formatDate value="${visit.date}" pattern="yyyy-MM-dd"/></td>
  60.         <td>${visit.description}</td>
  61.       </tr>
  62.     </c:if>
  63.   </c:forEach>
  64. </table>
  65. <%@ include file="/WEB-INF/jsp/footer.jsp" %>