tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gideon, Thomas" <Thomas.Gid...@B2eMarkets.com>
Subject RE: Properly iterating results with c:forEach?
Date Mon, 11 Nov 2002 20:26:27 GMT
Search for Resin in the list archives.  IIRC, there was a recent discussion
about buggy behavior with JSTL and Resin that may be helpful here, something
to do with Resin's own default implementation of JSTL conflicting with an
installed copy of the Jakarta RI.

Thomas Gideon
Sr. Software Developer
B2eMarkets

301.230.2236  Tel.
301.230.2248  Fax.
thomas.gideon@B2eMarkets.com
www.B2eMarkets.com



> -----Original Message-----
> From: Timothy Kettering [mailto:timster@mac.com]
> Sent: Monday, November 11, 2002 3:15 PM
> To: Tag Libraries Users List
> Subject: Re: Properly iterating results with c:forEach?
> 
> 
> 
> I'm using Resin 2.1.5 here.  I thought mabye I might be using a 
> outdated version of the JSTL taglib, so I downloaded 1.0.2 and 
> redeployed the webapp.  No change in the results.  Gonna give 
> it a shot 
> with Tomcat here and see.  The plot thickens....
> 
> -tim
> 
> On Monday, November 11, 2002, at 02:54 PM, Kris Schneider wrote:
> 
> > TC 4.1.14 + Standard Taglib 1.0.2:
> >
> > <p>Begin the count</br>
> >   <c:forEach var="i" begin="1" end="1">
> >     <c:out value="${i}"/>: one row here...<br>
> >   </c:forEach>
> > </p>
> >
> > <p>Begin the count</br>
> >   <c:forEach begin="1" end="1" varStatus="count">
> >     <c:out value="${count.count}"/>: one row here...<br>
> >   </c:forEach>
> > </p>
> >
> > Produces:
> >
> > Begin the count
> > 1: one row here...
> >
> > Begin the count
> > 1: one row here...
> >
> > Quoting Henri Yandell <bayard@generationjava.com>:
> >
> >>
> >> So, suggests that there's a bug with forEach when begin 
> equals end, it
> >> should print out once. JSTL people? :)
> >>
> >> Hen
> >>
> >> On Mon, 11 Nov 2002, Timothy Kettering wrote:
> >>
> >>> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
> >>>
> >>> Begin the count</br>
> >>>
> >>> 	<c:forEach begin="1" end="3" varStatus="count">
> >>> 		<c:out value="${count.count}"/>: one row here...<br>
> >>> 	</c:forEach>
> >>>
> >>>
> >>>
> >>> Begin the count
> >>> 1: one row here...
> >>> 2: one row here...
> >>> 3: one row here...
> >>>
> >>>
> >>> On Monday, November 11, 2002, at 02:27 PM, Henri Yandell wrote:
> >>>
> >>>>
> >>>>
> >>>> It looks like a bug to me, but I'm obviously not the 
> right person 
> >>>> for
> >>>> that
> >>>> :) What does start="1" end="3" return? 2 or 3? I figure that 
> >>>> whichever
> >>>> one
> >>>> of the three tests is unmatched, that's the bug.
> >>>>
> >>>> To get 1 value out, how about just using c:set?
> >>>>
> >>>> [not that I know what varStatus is. Not one I thought I'd used. ]
> >>>>
> >>>> Hen
> >>>>
> >>>> On Mon, 11 Nov 2002, Timothy Kettering wrote:
> >>>>
> >>>>> I've been banging my head on this for a bit, and I'm 
> not sure if 
> >>>>> its
> >>>>> me, or a bug in the functionality. I'm attempting to use JSTL to
> >>>>> iterate over an array of results, and heres what I'm doing.
> >>>>>
> >>>>> Heres a simple example:
> >>>>>
> >>>>> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
> >>>>>
> >>>>> Begin the count</br>
> >>>>>
> >>>>> 	<c:forEach begin="1" end="1" varStatus="count">
> >>>>> 		<c:out value="${count.count}"/>: one 
> row here...<br>
> >>>>> 	</c:forEach>
> >>>>>
> >>>>>
> >>>>> which gives me a result of this:
> >>>>>
> >>>>> Begin the count
> >>>>>
> >>>>>
> >>>>> Then if I change it to:
> >>>>>
> >>>>> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
> >>>>>
> >>>>> Begin the count</br>
> >>>>>
> >>>>> 	<c:forEach begin="1" end="2" varStatus="count">
> >>>>> 		<c:out value="${count.count}"/>: one 
> row here...<br>
> >>>>> 	</c:forEach>
> >>>>>
> >>>>> I get this:
> >>>>>
> >>>>> Begin the count
> >>>>> 1: one row here...
> >>>>> 2: one row here...
> >>>>>
> >>>>>
> >>>>> My question is.. how do I do this to get just one row 
> printed?  Its
> >>>>> either zero, or then two, and works fine after that.  
> Sometimes my
> >>>>> page
> >>>>> wants to return just one result, and no matter how i 
> diddle with 
> >>>>> stuff
> >>>>> here, I always end up with either a blank page, or a single row

> >>>>> that
> >>>>> prints correctly, and then a empty row, which isn't 
> what i want.  
> >>>>> Am I
> >>>>> missing something here?
> >>>>>
> >>>>> -tim
> >>>>>
> >>>>>
> >>>>> --
> >>>>> To unsubscribe, e-mail:
> >>>>> <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> >>>>> For additional commands, e-mail:
> >>>>> <mailto:taglibs-user-help@jakarta.apache.org>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>> --
> >>>> To unsubscribe, e-mail:
> >>>> <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> >>>> For additional commands, e-mail:
> >>>> <mailto:taglibs-user-help@jakarta.apache.org>
> >>>>
> >>>
> >>>
> >>> --
> >>> To unsubscribe, e-mail:
> >> <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> >>> For additional commands, e-mail:
> >> <mailto:taglibs-user-help@jakarta.apache.org>
> >>>
> >>>
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> >> <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> >> For additional commands, e-mail:
> >> <mailto:taglibs-user-help@jakarta.apache.org>
> >>
> >
> >
> > -- 
> > Kris Schneider <mailto:kris@dotech.com>
> > D.O.Tech       <http://www.dotech.com/>
> >
> > --
> > To unsubscribe, e-mail:   
> > <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: 
> > <mailto:taglibs-user-help@jakarta.apache.org>
> >
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:taglibs-user-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message