aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 60071
    
  65

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: 1016
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Programming HTML content inside Custom Tag Handler
 
Similar Threads
Jsp translation error
mock question regarding dynamic attribute
String[] as attribute to custom tag
Pass non string object as attribute to Tag File
question about <body-content>