aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question about custom tag handler and TLD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question about custom tag handler and TLD" Watch "Question about custom tag handler and TLD" New topic
Author

Question about custom tag handler and TLD

Paul Statham
Ranch Hand

Joined: Dec 05, 2008
Posts: 53
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: 53
Thanks Mike, pretty much what I thought it would be
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about custom tag handler and TLD