| Author |
Question about custom tag handler and TLD
|
Paul Statham
Ranch Hand
Joined: Dec 05, 2008
Posts: 38
|
|
Hi Guys,
I'm just working my through the HFSJ in chapter 9 it talks about a custom tag handler to go along with the TLD that is defined, here's a snippet from each
My question is, there is only one attribute associated with this tag, but if there was another attribute called say test, would you have to add another String called test and a method called setTest inside the TagHandler?
|
 |
Mike Zal
Ranch Hand
Joined: May 04, 2011
Posts: 144
|
|
If you want to add another attribute to the tag you must do the following:
1) Inside the TagHandler: Add the private String variable
2) Inside the TagHandler: Write the setter method for the attribute
3) Update the TLD to have another attribute element
4) Update the JSP code to use the new attribute and test it out
|
OCJP6, OCWCD5
|
 |
Paul Statham
Ranch Hand
Joined: Dec 05, 2008
Posts: 38
|
|
Thanks Mike, pretty much what I thought it would be
|
 |
 |
|
|
subject: Question about custom tag handler and TLD
|
|
|