Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Programming HTML content inside Custom Tag Handler

 
Mark Reyes
Ranch Hand
Posts: 426
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tag files could be appropriate if you want to include JSP and HTML markup.
 
Mark Reyes
Ranch Hand
Posts: 426
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1640
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic