wood burning stoves 2.0*
The moose likes JSP and the fly likes Programming HTML content inside Custom Tag Handler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Programming HTML content inside Custom Tag Handler" Watch "Programming HTML content inside Custom Tag Handler" New topic
Author

Programming HTML content inside Custom Tag Handler

Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi All,

I started exploring using custom tags and I am trying to experiment on some of its uses.

I declared my tld as this. My goal is that using my tag, I could display any collection class as HTML List Item



And use my tags like this.


The class that implements the tag is displayed below.



But I have a query, is this the only way to accomplish this task? It is as if I am programming HTML content on my servlet?


Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Tag files could be appropriate if you want to include JSP and HTML markup.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Tag files could be appropriate if you want to include JSP and HTML markup.


Ahh so thats where Tag Files really comes into the picture. Makes sense actually...

Thanks guru!
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
One comment,
You would need to declare the type of your attribute in your tld as List.
ie:


If you don't include the type tag, it will assume the default of String.
 
GeeCON Prague 2014
 
subject: Programming HTML content inside Custom Tag Handler