Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Programming HTML content inside Custom Tag Handler

 
Mark Reyes
Ranch Hand
Posts: 426
  • 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: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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
  • 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
Pie
Posts: 1670
10
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic