Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
14.8 Using Nested Tags
341
The JSP File
Listing 14.21 shows a JSP document that creates a numbered list of prime
numbers. The number of primes in the list is taken from the request time
repeats
 parameter. Figure 14 8 shows one possible result.
Listing 14.21 RepeatExample.jsp 
Some 40 Digit Primes
      HREF="JSP Styles.css"
      TYPE="text/css">

Some 40 Digit Primes

Each entry in the following list is the first prime number 
higher than a randomly selected 40 digit number.
<%@ taglib uri="csajsp taglib.tld" prefix="csajsp" %>
 >
  
  • 14.8 Using Nested Tags
    Although Listing 14.21 places the 
    csajsp:prime
     element within the 
    csa 
    jsp:repeat
     element, the two elements are independent of each other. The
    first generates a prime number regardless of where it is used, and the second
    repeats the enclosed content regardless of whether that content uses a 
    csa 
    jsp:prime
     element. 
    Some tags, however, depend on a particular nesting. For example, in stan 
    dard HTML, the 
    TD
     and 
    TH
     elements can only appear within 
    TR
    , which in turn
    Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
    Servlet and JSP training courses by book's author: courses.coreservlets.com.
    
    
    
    
    
    
    footer
    
    
    
    
    

     

     

     

     

     Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

    jsp web hosting

     

    Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

    Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved