home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-tomcat-addon-1.4.9-installer.exe / products.jsp < prev    next >
Encoding:
Text File  |  2004-08-28  |  1.8 KB  |  54 lines

  1. <!--
  2.   Copyright 2004 The Apache Software Foundation
  3.  
  4.   Licensed under the Apache License, Version 2.0 (the "License");
  5.   you may not use this file except in compliance with the License.
  6.   You may obtain a copy of the License at
  7.  
  8.       http://www.apache.org/licenses/LICENSE-2.0
  9.  
  10.   Unless required by applicable law or agreed to in writing, software
  11.   distributed under the License is distributed on an "AS IS" BASIS,
  12.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13.   See the License for the specific language governing permissions and
  14.   limitations under the License.
  15. -->
  16. <%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
  17. <html>
  18.   <head>
  19.     <title>JSP 2.0 Examples - Display Products Tag File</title>
  20.   </head>
  21.   <body>
  22.     <h1>JSP 2.0 Examples - Display Products Tag File</h1>
  23.     <hr>
  24.     <p>This JSP page invokes a tag file that displays a listing of 
  25.     products.  The custom tag accepts two fragments that enable
  26.     customization of appearance.  One for when the product is on sale
  27.     and one for normal price.</p>
  28.     <p>The tag is invoked twice, using different styles</p>
  29.     <hr>
  30.     <h2>Products</h2>
  31.     <tags:displayProducts>
  32.       <jsp:attribute name="normalPrice">
  33.     Item: ${name}<br/>
  34.     Price: ${price}
  35.       </jsp:attribute>
  36.       <jsp:attribute name="onSale">
  37.     Item: ${name}<br/>
  38.     <font color="red"><strike>Was: ${origPrice}</strike></font><br/>
  39.     <b>Now: ${salePrice}</b>
  40.       </jsp:attribute>
  41.     </tags:displayProducts>
  42.     <hr>
  43.     <h2>Products (Same tag, alternate style)</h2>
  44.     <tags:displayProducts>
  45.       <jsp:attribute name="normalPrice">
  46.     <b>${name}</b> @ ${price} ea.
  47.       </jsp:attribute>
  48.       <jsp:attribute name="onSale">
  49.     <b>${name}</b> @ ${salePrice} ea. (was: ${origPrice})
  50.       </jsp:attribute>
  51.     </tags:displayProducts>
  52.   </body>
  53. </html>
  54.