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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply 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: 56185
    
  13

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 1004
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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Programming HTML content inside Custom Tag Handler
 
Similar Threads
mock question regarding dynamic attribute
Pass non string object as attribute to Tag File
String[] as attribute to custom tag
question about <body-content>
Jsp translation error