[jboss-cvs] JBossAS SVN: r99948 - in projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main: webapp/WEB-INF/jsp and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jan 26 11:11:42 EST 2010
Author: lvlcek at redhat.com
Date: 2010-01-26 11:11:41 -0500 (Tue, 26 Jan 2010)
New Revision: 99948
Added:
projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/generateInvoice.jsp
Modified:
projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/java/org/jboss/snowdrop/samples/sportsclub/springmvc/AccountController.java
projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/accountDetail.jsp
projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/searchAccount.jsp
Log:
Spring MVC (work in progress)
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/java/org/jboss/snowdrop/samples/sportsclub/springmvc/AccountController.java
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/java/org/jboss/snowdrop/samples/sportsclub/springmvc/AccountController.java 2010-01-26 16:04:53 UTC (rev 99947)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/java/org/jboss/snowdrop/samples/sportsclub/springmvc/AccountController.java 2010-01-26 16:11:41 UTC (rev 99948)
@@ -64,4 +64,12 @@
return model;
}
+ @RequestMapping(value = "/generateInvoice.do", method = RequestMethod.POST)
+ ModelMap generateInvoice(@RequestParam("id") String id)
+ {
+ ModelMap model = new ModelMap();
+ model.addAttribute("id",id);
+ return model;
+ }
+
}
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/accountDetail.jsp
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/accountDetail.jsp 2010-01-26 16:04:53 UTC (rev 99947)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/accountDetail.jsp 2010-01-26 16:11:41 UTC (rev 99948)
@@ -1,14 +1,86 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%--<%@ 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/jstl/core" %>
<html>
<head><title>Sports Club: Invoicing - account detail</title></head>
<body>
-<form:form>
- ID = <c:out value="${account.id}"/>
+
+<div>Account details</div>
+
+<table>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Account ID:</td>
+ <td><c:out value="${account.id}"/></td>
+ </tr>
+ <tr>
+ <td>Created:</td>
+ <td><c:out value="${account.creationDate}"/></td>
+ </tr>
+ <tr>
+ <td>Subscriber name:</td>
+ <td>
+ <c:out value="${account.subscriber.name.firstName}"/>
+ <c:out value="${account.subscriber.name.middleName}"/>
+ <c:out value="${account.subscriber.name.lastName}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Subscriber address:</td>
+ <td>
+ <c:out value="${account.subscriber.address.streetAddress}"/>,
+ <c:out value="${account.subscriber.address.city}"/>,
+ <c:out value="${account.subscriber.address.provinceOrState}"/>,
+ <c:out value="${account.subscriber.address.country}"/>,
+ <c:out value="${account.subscriber.address.postalCode}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Membership:</td>
+ <td>
+ <c:out value="${account.membership.code}"/>
+ (<c:if test="${account.membership.active}">active</c:if><c:if
+ test="${!account.membership.active}">not active</c:if>)
+ </td>
+ </tr>
+ <tr>
+ <td>Balance:</td>
+ <td>
+ <c:out value="${account.balance.amount}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Billing type:</td>
+ <td>
+ <c:out value="${account.billingType}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Closed?:</td>
+ <td>
+ <c:out value="${account.closed}"/>
+ </td>
+ </tr>
+ <c:if test="${account.closeDate != null}">
+ <tr>
+ <td>Close date:</td>
+ <td>
+ <c:out value="${account.closeDate}"/>
+ </td>
+ </tr>
+ </c:if>
+</table>
+
+<form:form action="generateInvoice.do">
+ You can create new invoice for this account:
+ <input type="hidden" name="id" value="<c:out value="${account.id}"/>">
+ <input type="submit" value="Create invoice"/><br/>
</form:form>
+
</body>
</html>
\ No newline at end of file
Added: projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/generateInvoice.jsp
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/generateInvoice.jsp (rev 0)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/generateInvoice.jsp 2010-01-26 16:11:41 UTC (rev 99948)
@@ -0,0 +1,12 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
+
+<html>
+ <head><title>Sports Club: Invoicing - account invoice generated</title></head>
+ <body>
+ Invoice for account <c:out value="${id}"/> has been generated successfully!
+ <br/>
+ Go to <a href="searchAccount.do">account search</a> page.
+ </body>
+</html>
\ No newline at end of file
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/searchAccount.jsp
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/searchAccount.jsp 2010-01-26 16:04:53 UTC (rev 99947)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/searchAccount.jsp 2010-01-26 16:11:41 UTC (rev 99948)
@@ -1,6 +1,5 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%--<%@ 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/jstl/core" %>
More information about the jboss-cvs-commits
mailing list