Components That Make Up a 
Tag Library
The Tag Handler Class
Must implement javax.servlet.jsp.tagext.Tag 
Usually extends TagSupport or BodyTagSupport
Goes in same directories as servlet class files and beans
The Tag Library Descriptor File
XML file describing tag name, attributes, and 
implementing tag handler class
Goes with JSP file or at arbitrary URL
The JSP File
Imports a tag library (referencing descriptor file)
Defines tag prefix
Uses tags
79
JSP
www.corewebprogramming.com
Defining a Simple Tag Handler 
Class
Extend the TagSupport class
Import needed packages
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.*;
Override doStartTag
Obtain the JspWriter by means of pageContext.getOut()
Use the JspWriter to generate JSP content
Return SKIP_BODY
Translated into servlet code at page translation time
Code gets called at request time
80
JSP
www.corewebprogramming.com
40




  

Home

About Services Network Support FAQ Order Contact
 

Java Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting 

Lunarwebhost.net  Business web hosting division of Vision Web Hosting Inc. All rights reserved