Attributes in JSP Custom Tag
There can be defined too many attributes for any custom tag. To define the attribute, you need to perform two tasks:
Let's understand the attribute by the tag given below:
Here m is the prefix, cube is the tag name and number is the attribute.
Simple example of attribute in JSP Custom Tag
In this example, we are going to use the cube tag which return the cube of any given number. Here, we are defining the number attribute for the cube tag. We are using the three file here:
JSP Custom Tag attribute example with database
Let's create a custom tag that prints a particular record of table for the given table name and id.
So, you have to have two properties in the tag handler class.PrintRecord.java m.tld index.jsp
Outputdownload this example