This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Programming HTML content inside Custom Tag Handler  RSS feed

 
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
Posts: 66199
151
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
Posts: 1836
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
Boost this thread!