From: <jm...@us...> - 2005-11-10 03:53:48
|
Update of /cvsroot/struts/dialogs/war/shoppingpages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18060/war/shoppingpages Added Files: cart.jsp error.jsp shoppingitems.jsp Log Message: --- NEW FILE: cart.jsp --- <!-- Struts Dialogs MailReader, 2005. Web resource: Subscriptions. State: Logged In && CRUD_UI_MODE_INACTIVE --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <!-- The nice thing about using EL is that expressions can be used within Struts-EL tags. Without EL one would have to use, say, bean:write, which cannot be nested in other tag except as in the tag body. To nest expressions inside tags, one would have to use JSP scriptlets (which are calculated before tags?) --> <%@ taglib uri="http://struts.apache.org/tags-bean-el" prefix="bean-el" %> <%@ taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el" %> <%@ taglib uri="http://struts.apache.org/tags-logic-el" prefix="logic-el" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <html:xhtml/> <html> <body> <%-- Item ID: <c:out value="${cartForm.itemID}"/><br/> Cart: <c:out value="${cartForm.cart}"/><br/> Cart size: <c:out value="${cartForm.cart.items}"/><br/> Cart item: <c:out value="${cartForm.cart.items['aaa']}"/><br/> Item article No: <c:out value="${cartForm.cart.items['aaa'].articleNo}"/><br/> Item name: <c:out value="${cartForm.cart.items['aaa'].name}"/><br/> Item price: <c:out value="${cartForm.cart.items['aaa'].price}"/><br/> Item quantity: <c:out value="${cartForm.cart.items['aaa'].quantity}"/><br/> --%> <!-- Subscriptions for user: John Q. User --> <h3>Shopping cart</h3> <%-- Object: <c:out value="${cartForm.map.lines[0]}"/><br/><br/> --%> <html:form action="/Cart.do"> <TABLE WIDTH="80%" BORDER="1"> <TR> <TH align="left">Art.No.</TH> <TH align="left">Name</TH> <TH align="left">Price</TH> <TH align="left">Quantity</TH> <TH align="left">Operations</TH> </TR> <c:forEach var="lines" items="${cartForm.map.lines}" varStatus="status"> <TR> <TD><c:out value="${lines.articleNo}"/></TD> <TD><c:out value="${lines.name}"/></TD> <TD><c:out value="${lines.price}"/></TD> <TD><input type="text" name="lines[<c:out value="${status.index}"/>].quantity" value="<c:out value="${lines.quantity}"/>" size="3"></TD> <TD><html-el:link href="Cart.do?DIALOG-EVENT-DELETE&itemID=${status.index}"> Remove Item </html-el:link></TD> </TR> </c:forEach> </table> <br/> <html:submit property="DIALOG-EVENT-CHANGE">Update quantity</html:submit> </html:form> <%-- <html:form action="/Cart.do"> <input type="text" name="itemID" value="<c:out value="${cartForm.itemID}"/>"> <br/> <html:submit property="DIALOG-EVENT-CHANGE">Update1</html:submit> </html:form> <html:form action="/Cart.do"> <input type="text" name="cart.cartVersion" value="<c:out value="${cartForm.cart.cartVersion}"/>"> <br/> <html:submit property="DIALOG-EVENT-CHANGE">Update2</html:submit> </html:form> <html:form action="/Cart.do"> <input type="text" name="cart.map['aaa'].name" value="<c:out value="${cartForm.cart.items['aaa'].name}"/>"> <br/> <html:submit property="DIALOG-EVENT-CHANGE">Update4</html:submit> </html:form> <html:form action="/Cart.do"> <input type="text" name="cart.items" value="<c:out value="${cartForm.cart.items['aaa'].name}"/>"> <br/> <html:submit property="DIALOG-EVENT-CHANGE">Update3</html:submit> </html:form> <html:form action="/Cart.do"> <input type="text" name="cart.items.map['aaa'].name" value="<c:out value="${cartForm.cart.items['aaa'].name}"/>"> <br/> <html:submit property="DIALOG-EVENT-CHANGE">Update3</html:submit> </html:form> <html:form action="/Cart.do"> <c:forEach var="item" items="${cartForm.cart.items}"> Object: <c:out value="${item}"/><br/> Object Key: <c:out value="${item.key}"/><br/> Object Value: <c:out value="${item.value}"/><br/> Object Name: <c:out value="${item.value.name}"/><br/> <input type="text" name="cartForm.cart.items["<c:out value="${item.value.articleNo}"/>"].value.quantity" value="<c:out value="${item.value.quantity}"/>"> <br/> </c:forEach> <html:submit property="DIALOG-EVENT-CHANGE">Update quantity</html:submit> </html:form> <TABLE WIDTH="80%" BORDER="1"> <TR><TH align="left">Article No.</TH></TR> <c:forEach var="item" items="${cartForm.cart.items}" > <TR> <TD><html:text indexed="true" name="item" property="value.articleNo"/></TD> </TR> </c:forEach> </table> --%> <%-- <logic-el:iterate id="myItem" collection="${cartForm.cart.items}" type="net.jspcontrols.shoppingcart.CartItem"> Object: <c:out value="${myItem}"/> </logic-el:iterate> --%> <%-- <table width="100%"> <thead> <tr> <th>Art.No.</th> <th>Name</th> <th>Price</th> <th>quantity</th> <th>Operation</th> </tr> </thead> <logic-el:iterate id="myItem" collection="${cartForm.cart.items}" type="net.jspcontrols.shoppingcart.CartItem"> <tr> <!-- Subscription data --> <td><c:out value="${item.articleNo}"/></td> <td><c:out value="${item.name}"/></td> <td><c:out value="${item.price}"/></td> <td><c:out value="${item.quantity}"/></td> <!-- Operations on each subscription: updade and delete --> <td> <html-el:link href="Cart.do?DIALOG-EVENT-DELETE&itemID=${item.articleNo}"> Delete </html-el:link> </td> </tr> </logic-el:iterate> </table> --%> </body> </html:html> --- NEW FILE: error.jsp --- <%-- Errors.jsp - Display unexpected errors, such as a JSP exception or missing resources --%> <%-- Copyright 2000-2004 Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page import="org.apache.struts.Globals" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html> <head> <title>Unexpected Error</title> <html:base/> </head> <h3>An unexpected error has occured</h3> </body> </html:html> --- NEW FILE: shoppingitems.jsp --- <!-- Struts Dialogs MailReader, 2005. Web resource: Subscriptions. State: Logged In && CRUD_UI_MODE_INACTIVE --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <!-- The nice thing about using EL is that expressions can be used within Struts-EL tags. Without EL one would have to use, say, bean:write, which cannot be nested in other tag except as in the tag body. To nest expressions inside tags, one would have to use JSP scriptlets (which are calculated before tags?) --> <%@ taglib uri="http://struts.apache.org/tags-bean-el" prefix="bean-el" %> <%@ taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el" %> <%@ taglib uri="http://struts.apache.org/tags-logic-el" prefix="logic-el" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <html:xhtml/> <html> <head> <!-- Direct access to /mailreaderpages/* is prohibited in web.xml, use separate directory for CSS --> <link rel="stylesheet" type="text/css" href="mailreader-css/base.css" /> <title><bean:message key="subscriptions.title"/></title> </head> <body> <!-- Subscriptions for user: John Q. User --> <h3> <bean:message key="subscriptions.headingfor"/> <c:out value="${user.fullName}"/> </h3> <!-- Standard Struts error handling --> <logic:messagesPresent> <br/> <html:errors/> </logic:messagesPresent> <table width="100%"> <thead> <tr> <th>Art.No.</th> <th>Name</th> </tr> </thead> <!-- Show subscription list --> <logic-el:iterate collection="${shoppingForm.items}" id="item" type="net.jspcontrols.basket.business.ShoppingItem"> <tr> <!-- Subscription data --> <td><c:out value="${item.articleNo}"/></td> <td><c:out value="${item.name}"/></td> <!-- Operations on each subscription: updade and delete --> <td> <html-el:link href="ShoppingBasket.do?DIALOG-EVENT-ADDITEM&host=${item.host}"> Add to cart </html-el:link> </td> </tr> </logic-el:iterate> </table> </body> </html:html> |