JSP Tag Question

G

G Peoples

I want to make a tag that composites other tags in my tag libary. So rather
than doing


<libary:tag1/>
<libary:tag2/>
<libary:tag3/>
<libary:tag4/>
<libary:tag5/>

I can just do

<libary:bigtag/>

What I'm wanting to know is the best way to do this. I was thinking about
having my bigtag just instantiate each of the other tags and call the
various methods, but it seems to me that the container should be doing this.

Any advice ?
 
C

Chris Smith

G said:
I want to make a tag that composites other tags in my tag libary. So rather
than doing


<libary:tag1/>
<libary:tag2/>
<libary:tag3/>
<libary:tag4/>
<libary:tag5/>

I can just do

<libary:bigtag/>

The best answer is to implement bigtag with a JSP file, and write the
other tags exactly as you did. That requires you to be using JSP 2.0,
however.

In earlier JSP versions, factor the code out of the tag library into
utility classes, and call those from everywhere else.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top