mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-06-24 18:07:08 +00:00
46 lines
1.6 KiB
Text
46 lines
1.6 KiB
Text
<%@ 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" %>
|
|
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
|
|
|
|
|
|
<html lang="en">
|
|
|
|
<jsp:include page="../fragments/headTag.jsp"/>
|
|
|
|
<body>
|
|
<div class="container">
|
|
<jsp:include page="../fragments/bodyHeader.jsp"/>
|
|
<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}" class="form-horizontal" id="add-owner-form">
|
|
<petclinic:inputField label="First Name" name="firstName"/>
|
|
<petclinic:inputField label="Last Name" name="lastName"/>
|
|
<petclinic:inputField label="Address" name="address"/>
|
|
<petclinic:inputField label="City" name="city"/>
|
|
<petclinic:inputField label="Telephone" name="telephone"/>
|
|
|
|
<div class="form-actions">
|
|
<c:choose>
|
|
<c:when test="${owner['new']}">
|
|
<button type="submit">Add Owner</button>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<button type="submit">Update Owner</button>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</div>
|
|
</form:form>
|
|
</div>
|
|
<jsp:include page="../fragments/footer.jsp"/>
|
|
</body>
|
|
|
|
</html>
|