struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David M. Karr)
Subject Re: Another bright idea, make "indexed" work with JSTL forEach and friends
Date Sat, 04 Jan 2003 19:24:46 GMT
>>>>> "Craig" == Craig R McClanahan <> writes:

    Craig> On Sat, 4 Jan 2003, James Turner wrote:

    >> Date: Sat, 4 Jan 2003 13:26:34 -0500
    >> From: James Turner <>
    >> Reply-To: Struts Developers List <>
    >> To:
    >> Subject: Another bright idea,
    >> make "indexed" work with JSTL forEach and friends
    >> As has been pointed out, about the only remaining reason to use
    >> logic:iterate over c:forEach is that you can't use an html:text tag (or
    >> friends) with an "indexed" property set, because it only looks for
    >> logic:iterate on the page stack.
    >> Now, it would be very simple (having peered at the source) to have the
    >> html tags also look for JSTL iterators.  However, to make this work,
    >> we'd need to add a dependency on jakarta-taglibs so that the class would
    >> be available.
    >> I don't think that this would break anything in terms of JSP version
    >> support, since it wouldn't require evaluation of ELs, just looking up
    >> the stack to see if we find a JSTL interator hanging around.

    Craig> Unless you can do this all with reflection (instead of instanceof and
    Craig> direct method calls), you'll create NoClassDefFound errors for people who
    Craig> don't have the JSTL library in the stack.  Other than that caution, I'm
    Craig> +1.

That would be gnarly to try to do this with all string-based reflection (no
"ClassName.class" references or "instanceof" usage).  Writing a version of
"findAncestorWithClass" that takes a string instead of a Class is the first
step.  You'd also have to deal with allowing subclasses of the tag types.
That's probably the ugliest part.

At this point, I really don't see the urgency.

David M. Karr          ; Java/J2EE/XML/Unix/C++   ; SCJP; SCWCD

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message