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 / repeat.jsp < prev    next >
Encoding:
Text File  |  2004-08-28  |  1.5 KB  |  39 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="mytag" uri="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
  17. <html>
  18.   <head>
  19.     <title>JSP 2.0 Examples - Repeat SimpleTag Handler</title>
  20.   </head>
  21.   <body>
  22.     <h1>JSP 2.0 Examples - Repeat SimpleTag Handler</h1>
  23.     <hr>
  24.     <p>This tag handler accepts a "num" parameter and repeats the body of the
  25.     tag "num" times.  It's a simple example, but the implementation of 
  26.     such a tag in JSP 2.0 is substantially simpler than the equivalent 
  27.     JSP 1.2-style classic tag handler.</p>
  28.     <p>The body of the tag is encapsulated in a "JSP Fragment" and passed
  29.     to the tag handler, which then executes it five times, inside a 
  30.     for loop.  The tag handler passes in the current invocation in a
  31.     scoped variable called count, which can be accessed using the EL.</p>
  32.     <br>
  33.     <b><u>Result:</u></b><br>
  34.     <mytag:repeat num="5">
  35.       Invocation ${count} of 5<br>
  36.     </mytag:repeat>
  37.   </body>
  38. </html>
  39.