The final version of the Java Server Page Standard Tab Library (JSTL) 1.0 spec is now available. The JSTL defines a set of standard tags with functionality ranging from standard control flow, SQL access, i18N formatting, etc. JSTL also fully supports the new expression language under development in the JSP 2.0 spec.
Download JSP Standard Tag Libraries Final.
Read JSR 52: JSP Standard Tag Libraries.
-
JSP Standard Tag Libraries 1.0 Final Specification Available (23 messages)
- Posted by: Floyd Marinescu
- Posted on: July 09 2002 18:35 EDT
Threaded Messages (23)
- JSP Standard Tag Libraries 1.0 Final Specification Available by zhang xisheng on July 10 2002 02:28 EDT
- JSP Standard Tag Libraries 1.0 Final Specification Available by Hong Wang on July 10 2002 04:07 EDT
- JSP Standard Tag Libraries 1.0 Final Specification Available by Hong Wang on July 10 2002 04:18 EDT
- JSP Standard Tag Libraries 1.0 Final Specification Available by Simon Brown on July 10 2002 06:27 EDT
- JSP Standard Tag Libraries 1.0 Final Specification Available by Juergen Hoeller on July 10 2002 08:58 EDT
- JSP Standard Tag Libraries 1.0 Final Specification Available by Rogerio Liesenfeld on July 10 2002 11:14 EDT
- JSP Standard Tag Libraries 1.0 Final Specification Available by Martin Cooper on July 10 2002 12:13 EDT
- JSP Standard Tag Libraries 1.0 Final Specification Available by Vernon _ on July 10 2002 02:25 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Duc Nguyen on July 10 2002 02:39 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Rogerio Liesenfeld on July 10 2002 02:50 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Andre Augusto Oliveira Aragao on July 10 2002 07:57 EDT
- JSP Standard Tag Libraries 1.0 Final Specification Available by Rogerio Liesenfeld on July 11 2002 11:23 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Andre Augusto Oliveira Aragao on July 10 2002 07:57 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Dfd Dfdsf on July 10 2002 02:55 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Race Condition on July 10 2002 06:50 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Rogerio Liesenfeld on July 11 2002 11:16 EDT
- JSP Standard Tag Libraries 1.0 Final Specification Available by Dfd Dfdsf on July 11 2002 11:48 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Race Condition on July 11 2002 01:26 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Rogerio Liesenfeld on July 11 2002 02:04 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Race Condition on July 11 2002 02:46 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Rogerio Liesenfeld on July 11 2002 04:40 EDT
- JSP Standard Tag Libraries 1.0 Final Specification Available by Shawn Bayern on July 11 2002 08:22 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Rogerio Liesenfeld on July 11 2002 04:40 EDT
- JSP Standard Tag Libraries 1.0 Final Specification Available by Race Condition on July 11 2002 02:48 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Race Condition on July 11 2002 02:46 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Rogerio Liesenfeld on July 11 2002 02:04 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Rogerio Liesenfeld on July 11 2002 11:16 EDT
- JSP Standard Tag Libraries 1.0 Final Specification Available by Andre Augusto Oliveira Aragao on July 10 2002 08:09 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Race Condition on July 10 2002 06:50 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available by Rogerio Liesenfeld on July 10 2002 02:50 EDT
-
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: zhang xisheng
- Posted on: July 10 2002 02:28 EDT
- in response to Floyd Marinescu
where can I get some sample ? who can offer me ,thanks:-) -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Hong Wang
- Posted on: July 10 2002 04:07 EDT
- in response to zhang xisheng
http://java.sun.com/products/jsp/jstl/index.html
check the book
JSTL in Action, Shawn Bayern, Manning
-
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Hong Wang
- Posted on: July 10 2002 04:18 EDT
- in response to zhang xisheng
-
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Simon Brown
- Posted on: July 10 2002 06:27 EDT
- in response to zhang xisheng
When you download the JSTL 1.0 distribution (available from the Jakarta site), you get a prebuilt web application (standard-examples.war) that you can drop straight into a JSP 1.2 compliant container such as Tomcat 4.
Certainly worth a look as there's some great stuff in there...
Simon
-----
Author of Professional JSP Tag Libraries (sample chapters available) -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Juergen Hoeller
- Posted on: July 10 2002 08:58 EDT
- in response to Floyd Marinescu
I have already played a lot with the JSTL (reference implementation and also Resin's optimizations), and I have to say that I really like it. I have not been too keen on tag libraries for nearly two years, but that changes currently.
Especially valuable is the handling of localization and i18n resource bundles, formatting and parsing, conditions and iterations. A lot of Java code in JSPs can be replaced in a standardized way now, with JSTL tags. And the focus on error tolerance in the expression language is great for page scripting: No more "!= null" checks for dependent objects.
I'm still concerned about efficient tag handling and EL expression evaluation, though. Due to its heavy usage of reflection EL has to be slower than Java scriptlets. And you lose static type checks and compile-time error messages. But it seems to me that its ease of use more than compensates for these drawbacks.
Altogether a great addition to the Java web app developer's toolkit!
Regards,
Juergen -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Rogerio Liesenfeld
- Posted on: July 10 2002 11:14 EDT
- in response to Juergen Hoeller
Indeed, the JSTL is an excellent tag library. The JCP really did a good job on this. I am currently using it in a small web app, originally written with Struts. I was able to replace all the tags from the Struts tag libraries "struts-bean" e "struts-logic" with tags from the JSTL's "core" tag library. I am also using the "fmt" JSTL tag library, to format number and dates.
I wouldn't recommend using the "sql" and "xml" tags, though, since that is better done outside the JSP files.
The EL may incur a performance penalty now, but this will change next year, after JSP 2.0 is out: one of its main goals is to incorporate JSTL's expression language (possibly with some modification) in JSP itself, which will also allow its use in template text, not only in tag attributes. -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Martin Cooper
- Posted on: July 10 2002 12:13 EDT
- in response to Juergen Hoeller
I wouldn't be worried about the performance hit of reflection, unless you're using a very old JDK. The last two versions, at least, have both made huge improvements in performance, to the point where there's really no reason to worry about the cost of using it any more. -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Vernon _
- Posted on: July 10 2002 14:25 EDT
- in response to Martin Cooper
I disagree with your comment on the performance. I only use the i18n portion of JSTL in my current project and experiencing dramatic performance deterioration on Tomcat 4.0.4. I am informed the performance will be better for the TC4.1. That issue doesn't seem to has no any connection with JDK. -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Duc Nguyen
- Posted on: July 10 2002 14:39 EDT
- in response to Martin Cooper
Okie I know that doing SQL Stuff directly in JSP page is not the best way to do thing, but if I want to populate a list(drop down box ex: Product Name), and all this information are drawing out from the database. How would I do it. I mean what is the best way to do this other than using the JSP Tag.
Duc -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Rogerio Liesenfeld
- Posted on: July 10 2002 14:50 EDT
- in response to Duc Nguyen
Here is how you could do it using the Struts "html" tag library:
<html:select name="myBean" property="productName">
<html:options name="myBean" property="productNames"/>
</html:select>
where "myBean" is a session or request attribute pointing to an instance of say, "com.acme.ProductForm" (a JavaBean), and "productNames" is a method that returns a collection populated from a "products" table.
This is just one way of doing it, without embedding any SQL code in the JSP page.
-
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Andre Augusto Oliveira Aragao
- Posted on: July 10 2002 19:57 EDT
- in response to Rogerio Liesenfeld
I'm using struts to develop an application. I have an action, that has an input page, and a result page. However, the input page needs information that is in the model. Following mvc, I can“t access the model directly from view. With struts, the input page is called before calling the action. Strictly following MVC, how can I populate the input page with model info I need?
The example you did is fine, however, how did you create/populate the bean myBean first? Where you did it? -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Rogerio Liesenfeld
- Posted on: July 11 2002 11:23 EDT
- in response to Andre Augusto Oliveira Aragao
Hi Andre,
You can find answers for these questions in the open source JPetStore web application, which is implemented with Struts.
You can find it here: iBATIS JPetStore
(I actually don't use Struts, because I think it's too complicated for what it does, and the use of JSP tags such as <html:text> is not what want to see in a JSP page that produces HTML.)
Cheers,
Rogerio -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Dfd Dfdsf
- Posted on: July 10 2002 14:55 EDT
- in response to Duc Nguyen
From the introduction of the spec, it says it is for Nonprogrammers. How many of us here really are not programmers? Is it really true a nonprogrammer can use the thing? I found the flow control part is really awkward. This may inherit(emulate) from XSLT. May it has some good stuff, howerver claiming the ... is for people who don't understand programming languges is just misleading.
-
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Race Condition
- Posted on: July 10 2002 18:50 EDT
- in response to Dfd Dfdsf
That's the problem. We ARE programmers and using tags is a step backwards. Tags suck. Tags are for Html authors. JSPs suck. Reflection sucks. Use presentation servlets with RAW Java. -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Rogerio Liesenfeld
- Posted on: July 11 2002 11:16 EDT
- in response to Race Condition
I don't agree that using tags is a step backwards, and I don't care what they say in the spec with respect to whom they are targetted. I would glady give up a general purpose programming language for a more high level, declarative language, that is focused on the problem at hand (in this case, expressing an UI design). Generating HTML with raw Java code in a servlet is the real step backwards, IMO.
-
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Dfd Dfdsf
- Posted on: July 11 2002 11:48 EDT
- in response to Rogerio Liesenfeld
Tag libraries may be convenient for something absolutely necessary. I feel that people go too far in this direction. Like struts, it invented every tag html has. You also find these standards, specs and implementations trying to copy or emulate from each other. You really don't know these stuffs make developers' life easier or more miserable. This may be just a phrase of the evolution process anyway.
-
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Race Condition
- Posted on: July 11 2002 13:26 EDT
- in response to Rogerio Liesenfeld
Have you ever used the ElementConstructionSet? It's a very efficient way to write Html.
-
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Rogerio Liesenfeld
- Posted on: July 11 2002 14:04 EDT
- in response to Race Condition
So, you say that writing this (from Jakarta ECS):
Document doc = new Document()
.appendTitle("Demo")
.appendBody(new H1("Demo Header"))
.appendBody(new H3("Sub Header:"))
.appendBody(new Font().setSize("+1")
.setColor(HtmlColor.RED)
.setFace("Times")
.addElement("The big dog & the little cat chased each other."));
output(out);
is actually preferable to writing this:
<html><head><title>Demo</title></head>
<body>
<h1>Demo Header</h1>
<h3>Sub Header:</h3>
<font size="+1" color="red" face="Times">The big dog & the little cat chased each other.</font>
</body>
</html>
(Note that this HTML code works, as can be verified in a browser, without requiring the use "&" or "#FF0000" as stated in the Jakarta ECS page.)
Well, maybe it's just me, but I would choose the HTML version any day (even though I am a Java/C/C++/VB/XSL programmer). And if you consider using CSS instead of that ugly, deprecated, <font> tag, it would be even easier (Can ECS do what CSS does? If not, why should I give up a fantastic technology such as CSS, in exchange for a lot of repetitive Java code?)
Cheers,
Rogerio -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Race Condition
- Posted on: July 11 2002 14:46 EDT
- in response to Rogerio Liesenfeld
No man. Don't use it for all of the Html. Iterative things, looping, etc. Like building a table or a select control. And yes, CSS is easily used with ECS.
TD td = new TD();
td.setClass(SOME_CONSTANT_CSS_CLASS_NAME);
-
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Rogerio Liesenfeld
- Posted on: July 11 2002 16:40 EDT
- in response to Race Condition
Why not just use JSTL, if all you need is loops and conditionals? Note that I took the ECS example code right from Jakarta ECS front page. And if you just use ECS to set the name of a CSS class, what's the point? You are really using CSS, not ECS (which would imply having an API capable of attaching and expressing style specifications, in ECS itself). -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Shawn Bayern
- Posted on: July 11 2002 20:22 EDT
- in response to Rogerio Liesenfeld
Hi there. I'm the RI lead for JSTL and the author of "JSTL in Action." (It was great to see someone mention it earlier!) I'm encouraged by all the great positive feedback we've gotten for JSTL here -- I'm very pleased that people are finding it useful and efficient.
I'm just writing to mention that my publisher, Manning, will be making the entire text of "JSTL in Action" available for free online in PDF format. Feel free to visit http://www.jstlbook.com for updates; I've been keeping that page up to date and will add links once the PDFs are available. (The printed book itself will ship on July 29, I'm told.)
I'm always happy to answer any questions about the JSTL RI on taglibs-user at jakarta dot apache dot org or through personal email (bayern at essentially dot net), in case that's useful.
--
Shawn Bayern
Preorder JSTL in Action" -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Race Condition
- Posted on: July 11 2002 14:48 EDT
- in response to Rogerio Liesenfeld
One other thing: If I were to use presentation servlets instead of JSP, I could easily use inheritance. -
JSP Standard Tag Libraries 1.0 Final Specification Available[ Go to top ]
- Posted by: Andre Augusto Oliveira Aragao
- Posted on: July 10 2002 20:09 EDT
- in response to Dfd Dfdsf
dfd,
I agree with your point. Explaining what a collection is, and where did it came from is a hard task when you're dealing with a designer. I suffered it. However, one thing is for sure: if you keep your explanation simple, not getting down to details, it's possible. And it's far better than RAW java or jsp scriptlets, from a maintenance perspective.