Jakarta Project: Unstandard Tag library

Version: 1.0

Table of Contents

Overview

Your unstandard description summary.

This JSP tag library can be used to ....

etc....

Requirements

This custom tag library requires no software other than a servlet container that supports the JavaServer Pages Specification, version 1.1 or higher. Plus any requirements for additional API packages.

Configuration

Follow these steps to configure your web application with this tag library:

To use the tags from this library in your JSP pages, add the following directive at the top of each page:

<%@ taglib uri="http://jakarta.apache.org/taglibs/unstandard-1.0" prefix="un" %>

where "un" is the tag name prefix you wish to use for tags from this library. You can change this value to any prefix you like.

Tag Summary

Unstandard Tags
equalsEquals compares two strings
instanceOfInstanceOf compares an object with a type
invokeInvokes a method upon a target object
bindBind a variable from a Java class into the context
sizeWork out the size of a String, Collection, Map or Object[]
useConstantsExpose Java class constants as a map of values
 

Tag Reference

equals Availability: 1.0

Equals compares two strings

Tag Bodyempty    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 var  No   No  
 

Attribute description

 ignoreCase  No   No  
 

Attribute description

 lhs  Yes   No  
 

Attribute description

 rhs  Yes   No  
 

Attribute description

VariablesNameScopeAvailability
  var attribute value   Start of tag to end of page  1.0
 

Equals result

 PropertiesNone
Examples Here is a comment.  
  <% File tempdir = (File)application.getAttribute ("javax.servlet.context.tempdir"); %>
<% String echoLog = tempdir+"/echoAppendLog.txt";%>
<% String messageString = "Hello World. The time is: " + time+System.getProperty("line.separator"); %>


            <foo:bar attr1="<%= expr %>" attr2="val2" attr3="<%= expr2 %>" /> 
          

instanceOf Availability: 1.0

InstanceOf takes an object and a string and sets the attribute named by "var" to true or false depending on the results

Tag Bodyempty    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 var  No   No  
 

Attribute description

 value  Yes   No  
 

Attribute description

 type  Yes   No  
 

Attribute description

VariablesNameScopeAvailability
  var attribute value   Start of tag to end of page  1.0
 

Equals result

 PropertiesNone
Examples Here is a comment.  
  <% File tempdir = (File)application.getAttribute ("javax.servlet.context.tempdir"); %>
<% String echoLog = tempdir+"/echoAppendLog.txt";%>
<% String messageString = "Hello World. The time is: " + time+System.getProperty("line.separator"); %>


            <foo:bar attr1="<%= expr %>" attr2="val2" attr3="<%= expr2 %>" /> 
          

invoke Availability: 1.0

Invokes a method upon a target object

Tag Bodyempty    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 var  Yes   No  
 

Attribute description

 target  Yes   No  
 

Target to invoke the method upon

 method  Yes   No  
 

The method to invoke

VariablesNameScopeAvailability
  var attribute value   Start of tag to end of page  1.0
 

Invoke method on an object

 PropertiesNone
ExamplesNone
bind Availability: 1.0

Bind a variable from a Java class into the context

Tag Bodyempty    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 var  Yes   No  
 

Attribute description

 target  No   No  
 

Target to get the value from

 type  No   No  
 

For static attributes, target may not be specified and instead type may be specified

 field  Yes   No  
 

The field to get

VariablesNameScopeAvailability
  var attribute value   Start of tag to end of page  1.0
 

Bind a variable from a Java class into the context

 PropertiesNone
ExamplesNone
size Availability: 1.0

Work out the size of a String, Collection, Map or Object[]

Tag Bodyempty    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 var  Yes   No  
 

Attribute description

 target  No   No  
 

Target to get the value from

VariablesNameScopeAvailability
  var attribute value   Start of tag to end of page  1.0
 

The variable into which the length may be put

 PropertiesNone
ExamplesNone
useConstants Availability: 1.0

Exposes all of the public constants in a class as a map stored in a scoped attribute. The scope may be specified, but defaults to page scope.

Tag Bodyempty    
Restrictions

None

AttributesNameRequired Runtime Expression Evaluation Availability
 var  Yes   No  
 

Name of the scoped attribute into which the map will be stored.

 className  Yes   No  
 

Fully qualified name of the class from which constants will be extracted.

 scope  No   No  
 

Scope into which to store the map. Default is page scope.

VariablesNameScopeAvailability
  var attribute value   Start of tag to end of page  1.0
 

The name of the attribute into which the map will be stored.

 PropertiesNone
Examples To expose all of the constants in the Integer class:  
 


            <un:useConstants var="const" className="java.lang.Integer" /> 
          

Examples

See the example application unstandard-examples.war for examples of the usage of the tags from this custom tag library.

Java Docs

Java programmers can view the java class documentation for this tag library as javadocs.

Revision History

Review the complete revision history of this tag library.