Class 2 |
Intermediate Java 30-IT-397 |
|
Tag Attributes
-
Attributes are name-value pairs within the tag.
-
Think of HTML, such as the <FORM> tag. Its attributes
are METHOD, ACTION, NAME, and a few others. Example:
<FORM NAME="SignupForm" METHOD="POST" ACTION="signup.jsp">
-
With a JSP tag, this would be very similar: <prefix:name att1="value1"
att2="value 2" />
-
A tag handler is essentially a JavaBean. Thus, these attributes are
variables in the class, and can be accessed via getter and setter methods.
Only setter methods are required, but there are many cases where you will
need the getter methods as well.
-
void setAtt1(String value1), void setAtt2(String value2)
-
String getAtt1(), String getAtt2().
-
You might notice that the first letter of the attribute in the tag is lowercase,
while the first letter of the attribute in the method definition is uppercase.
This is correct.
Changing the .tld

Created by: Brandan Jones
December 17, 2001