The Jakarta Taglibs project has released version 1.0 of the following JSP 1.1 Standard Tag Libraries: Application, DateTime, Mailer, Page, Random, Regexp, Request, Response, Session, XSL.
Check out the Jakarta Taglibs
Have you seen Coldtags suite: www.servletsuite.com/jsp.htm
The only problem for us that it is not Open Source, but
by the functionality we have not seen something similar.
Am i the only one who these taglibs (and the cold java ones) strike as particularly useless
Its yet another set of commaands to learn at to what ends , because it looks nice in the jsp ?? these taglibs are mostly just macros
And in the end you'll probably end up mixing a lot of scriptlets with some of these tag anyway, making it even harder to comprehend then scriptlets alone
Really, the only really usefull taglib i've seen sofar is the one used in webwork. do you really need a date/time tag ?
I generally agree with your assessment because I am a Java programmer. For whatever reason, UI folks completely freak out when they see braces and such.
To me tag-libs usually complicate the solution -- especially when they are nested, but that is because my goggles think in Java not in tags. Also, I'm comfortable with MVC and whatnot - UI dudes completely wig-out when you talk to them about MVC.
What I like about having a standard tag library is that I see it giving me an alternative to not so strategic technologies like ColdFusion.
For better or worse, the "Full Time UI Guy/Part Time Developer" is a market that needs to be served.
JSTL moves my company one step closer to being able to standardize on Java. Do I like tag-libs? Not really. Do I like tag-libs better than ColdFusion? Yes.
Of course, there might be situations where you need to include scriptlets within your JSPs. However, most of the scriptlets are used for rather trivial tasks like iteration or conditional evaluation ("for" and "if"), ending up with mixing the hierarchy of HTML tags and brackets in scriptlets. Did you ever try to debug such constructs.
I dont think I'll need the Date/Time Tag, yet I consider the conditional and iterational tags very useful for almost all JSP developers.
Most of the other taglibs are only "nice-to-have", but there might be a lot of developers that come from ColdFusion fraction and they will be very glad about those tags.
Jelmer's argumentation, that the taglibs are just another language to learn, is not correct, as you might also state, that JSP are not useful, because you've got to learn JSP syntax and you can do that with Servlets anyway...
Yes, taglibs are macros in many aspects. But it is the only way to re-distribute and reuse JSP/HTML stuff. Plus, not
all Web-developers are Java developers. What about Coldfusion? And even worse for Sun, what about ASP.NET ?
Have you seen their web controls? From our opinion the crap is actually Webwork and related stuff. Why do not concentrate on standard stuff - taglibs, why Sun can not
produce something better than ASP.NET ?
>do you really need a date/time tag ?
as a Java programmer - probably no. But try to scan any
forum/board related to JSP and check "how to do ..." questions
The important thing about the tag libraries is its standardization. That way, we all know what exists, we all know what it looks like, and we all know how it works (well, how we expect it to work anyway).
Sun is doing JSTL exactly for the purpose of standardization.
Having "another set of commands to learn" is not a bad thing if what we learn is used and reused. If there is a core common to all, we'll benefit from the full potential of taglibs.
I guess you have not fully understood the consequences of custom tags. If you use these correctly there i NO scriplets in there. The reasoning for custom tags is that jsp's are not a java-developer domian, but a html-developer doamin. How many of the latter would you trust your business logic to.
Am i the only one who these taglibs (and the cold java ones) strike as particularly useless <
I agree . . . When I started JSP programming I expected to find a wealth of good tags ready to use, but all I could find was junk. (As far as I can tell, Jakarta doesn't even include an iterator tag). Now that I've developed my own tag library I'm amazed at how much easier it makes JSP development.
I'm with you. I haven't had much luck with any of the publicly available taglibs. I do, however have my own custom set of taglibs that I use regularly, and find indispensible. They are a trememdous help. I would never say taglibs are useless, they just have their place. Cough.. Cough.. Much like xml...
The Jakarta Taglibs project has released version 1.0 of
>the following JSP 1.1 Standard Tag Libraries: Application,
>DateTime, Mailer, Page, Random, Regexp, Request, Response,
If I could correct a slight misstatement here: none of these libraries are part of the JSP *Standard* Tag Libraries (JSTL). The JSTL is being defined by the JSR-052 Expert Group as part of the Java Community Process (JCP). The reference implementation is being by the Jakarta project. Here's a link:
So while these tag libraries may be useful and interesting (or not, as some people have indicated), they're not part of the JSTL.
What I would really like to see is an analysis paper where somebody proves what a "complete set" of tags is - in the sense of vector spaces. That's the real issue - knowing when you have enough. Then we can all start using the same tags.
I work for a web UI firm, but have many years background with SGML/XML and also with Java. In general, I think Tags are good because their syntax, at least on the superficial level, is easy to validate. In other words, as long as there is an open tag and a close tag, or an appropriate empty tag, at least superficially, the syntax is valid.
For people who work on web pages (especially doing page maintenance after page integration with the middle-tier), my observation is that it is harder for them to mess up tag syntax than to mess up Java syntax--especially if the Java code is tighly interwoven with the HTML.
Personally, I did some work recently with the JSTL XML Taglib and liked working with it. But, in truth, I mixed it with scriplets to get the results I needed! But, I could imagine as Taglibs develop more the scriplets I needed also being superceded by tags. The JSTL and Apache Taglibs are great projects with futures to look forward to.
Finally, I would defintely use the Date/Time Taglib to captialize on its formatting and internationalization features. Maybe it is almost trivial enough to do this with a small scriplet, but a Taglib is one technique for having a standard way of doing this.
Not sure what you mean by "validating" pages constructed
of JSP custom tags. Were you referring to using XML-like
validation with an XML editor such as XMLSpy? I'd be
interested in knowing what tools you used for this.
I found that there's a basic divergence of XML and JSP.
Standard JSP will allow constructs, quite commonly used
ones, that are not well-formed XML. This is the
<jsp:text> tag, where you could have
for example. This would be legal JSP, but the
XML editor would not validate it.
In addition, the JSP/XML syntax is very limited as
implemented, the JSP servers ignore things it doesn't
recognize, rather than pass them through.
Even legal JSP 1.2 implementations of JSP/XML currently
have problems (weblogic 6.1). In simple tests of example
code from the Java trade rags, tags were dropped or
missing when the result was sent to the browser.
Once you can validate JSP custom tag libs in XML editors,
then you're in business.
Don't know if there's much chance of this happening.
I would also be tracking Cocoon, hopefully some well-
supported technology will emerge from that.
When you try to generalize a problem, the result is a pattern; when you try to fit a problem in a pattern, result is Tag lib!
In theory taglibs are designed for a different kind of people, not core Java programmers. Often those people have a HTML, designer or even Coldfusion alike background and don't have a whole lot of knowledge about Java or even programming in general. Taglibs enable them to do what they were used to do without having to dig into Java. And believe me, you don't want them to learn Java! So in theory taglibs are a very good idea. The down side however is that in most cases you as a Java developer end up doing the JSP stuff as well because the organization thinks JSP = Java = programming, the designers think JSP = Java = programming. So you're stuck. You may think taglibs are a bad idea but they do safe you a lot of repeating code and speed up your JSP development proces. You should have an open mind about taglibs, at least that my opinion.