Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
350
Chapter 14 Creating Custom JSP Tag Libraries
Listing 14.27 csajsp taglib.tld (continued)
  
    then
    coreservlets.tags.IfThenTag
    then part of if/condition/then/else tag.
    JSP
  
  
    else
    coreservlets.tags.IfElseTag
    else part of if/condition/then/else tag.
    JSP
  
The JSP File
Listing 14.28 shows a page that uses the 
csajsp:if
 tag three different ways.
In the first instance, a value of 
true
 is hardcoded for the condition. In the
second instance, a parameter from the HTTP request is used for the condi 
tion, and in the third case, a random number is generated and compared to a
fixed cutoff. Figure 14 9 shows a typical result. 
Listing 14.28 IfExample.jsp 
If Tag Example
      HREF="JSP Styles.css"
      TYPE="text/css">

If Tag Example

<%@ taglib uri="csajsp taglib.tld" prefix="csajsp" %>
  true
  Condition was true
  Condition was false
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