Basic Taglib tld Tags | |
---|---|
tag | purpose |
<?xml | Which version of XML (extensible Markup Language) is being used and which encoding. |
<taglib | Miscellaneous information about where to find a DTD (Document Type Definition) to describe the xml grammar of the file |
<description> | Surrounds some text documenting what this jsp-tag as whole is for. |
<tag> | Surrounds tags describing one jsp tag. |
<tag-class | qualified class name that implements javax.servlet.jsp.tagext. Tag to implement this jsp tag. |
<teiclass | optional subclass of javax.servlet.jsp.tagext.TagExtraInfo. |
<body-content | Can have the values empty, JSP, scriptless or tagdependent. A one-liner jsp tag would have an empty body. A jsp tag that surrounded some text would be set to JSP to evaluate the body of the tag. |
<info> | Documentation on what this jsp tag is for. |
<variable> | Surrounds tags describing one EL variable exposed to the calling page. |
<attribute> | Surrounds tags describing one parameter of the jsp tag. |
<name | Name of the keyword parameter used in the jsp files when the tag is invoked. Your handler will be passed the value of the parameter via its setXxx method where xxx matches the name of the keyword parameter. |
<required | true if the parameter must be present. |
<rtexprvalue | by default false. If true, the user may calculate this parameter’s value with a scriptlet. |
You must write getters and setters for each parameter and a SimpleTagSupport.doTag or TagSupport.doStartTag method to generate the HTML from the parameter values.
Oddly, TagSupport has a completely different way of finding associated information. TagSupport has a protected field called pageContext. From there you can find the other control objects such as: JspWriter with getOut where you write the expanded HTML, Servlet with getPage, ServletRequest with getRequest, ServletResponse with getResponse, ServletConfig with getServletConfig and ServletContext with getServletContext.
Most of the navigation in convoluted, but straightforward. Getting the URL (Uniform Resource Locator) of the page you are generating is trickier:
This page is posted |
http://mindprod.com/jgloss/taglibs.html | |
Optional Replicator mirror
|
J:\mindprod\jgloss\taglibs.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[18.191.165.149] |
| |
Feedback |
You are visitor number | |