On 12/22/05, fea jabi <[EMAIL PROTECTED]> wrote:
>
> Thanks, Laurie. that worked.
>
> why is JSTL prefered over the logic tags? is there any doc I can read
> about
> the same?
>
> Thanks.


A couple of reasons I (as the original developer of the logic tags :-)
prefer the JSTL versions:

* The expression syntax for JSTL's logic tags is much more powerful
  and concise.

* JSTL provides the equivalent of a "switch" statement in Java or C
  for dealing with if/else or if-elseif-elseif-else type scenarios.  Struts
does not.
  See the <c:choose>, <c:when>, and <c:otherwise> tags.

* The JSTL tags are provided by the container, and can potentially be
  performance optimized by the container provider.

* The JSTL expression syntax is now (as of JSP 2.0) available everywhere
  in a JSP page, not just in tags that understand the syntax.

* The JSTL syntax is very similar to the JSF expression syntax, so if you
  ever switch to using JSF for your view technology, you won't have to
  learn a new expression language syntax.

The Struts logic tags preceeded JSTL, but they have basically been
superceded by the standard functionality.  They're still in the library
primarily for backwards compatibility.

Craig

Reply via email to