This week's giveaway is in the Java/Jakarta EE forum. We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line! See Are they superior...should I be using them in the place of custom tag libraries? What are the basic limitations in any of your experiences?
It would appear that they are a matter of mixing scriptlet code into a JSP...exactly what you would *not* want to be doing in a regular JSP. Is this the case?
I kinda like the tagfile facility provided in JSP 2.0. To me, they provide a simple yet efficient way to reuse UI element because of the textual representation, rather than compiled custom tag.
I would say that tagfile are superior than custom taglib in term of their ability to manipulate textual contents naturally. Drawing a loose analogy, a tagfile to custom taglib is just like a jsp file to a servlet.
However, if you don't want page developer or web designer to access your tag logic, put them in custom tag rather than tagfile.
SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
They are complimentary, not competing technologies. Tag files are most useful when your tag focuses mainly on markup. In this way, you avoid having to build up markup in text strings and then emit them. Java-based tags are still a good choice for less markup-intensive uses. I use both types on a regular basis.
Tag files, btw, are implemented by the container by turning them into "regular" Java-based tags behind the scenes.
t would appear that they are a matter of mixing scriptlet code into a JSP...exactly what you would *not* want to be doing in a regular JSP. Is this the case?
Absolutely not. In fact, you cannot use scriplets or scriplet expressions in a tag file. [ October 16, 2005: Message edited by: Bear Bibeault ]
Thanks guys, very helpful. Bear, you make an excellent point. If I were to implement markup in my tags - tagfiles are obviously the way to go to avoid a pile of pasta w/ print statements in a custom tag.
So far as I can tell, tagfiles can do anything a custom taglib can do...but easier (for UI elements.)
Now, if only I could get one to work...but that's for another thread.