commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Anderson <benander...@benanderson.us>
Subject [JELLY] Re: j:forEach bug
Date Thu, 23 Sep 2004 16:59:16 GMT
I'll post my patch to jira tomorrow - I left the code at work.  The JSTL 
compliance I'm referring to is the varStatus attribute, which according 
to the jstl spec should implement 
javax.servlet.jsp.jstl.core.LoopTagStatus.  Meanwhile the jelly 
attribute assigns a variable with type of Integer which is an index.  I 
would like to do something like this, which works nicely using the 
Standard 1.1 taglibs.
<j:forEach var="element" items="${list}" varStatus="status">
    <j:if test="${status.last}">
        this is the last time through
    </j:if>
</j:forEach>
I know there are other ways to do this, but is seems to me the jstl way 
is much nicer ;-)
-Ben

Paul Libbrecht wrote:

> Ben,
>
> There has been several considerations on making j:forEach more jstl  
> compliant... you might to consider them first:
>
> http://nagoya.apache.org/jira/secure/IssueNavigator.jspa? 
> reset=true&mode=hide&summary=true&description=true&query=forEach
>
> Do note that Jelly uses Jira and not Bugzilla!
>
> To make your patch, I think there's an option of "cvs diff" that 
> allows  a unified diff...
>
> All in all, I haven't understood very well what is the goal of your  
> change!
>
> Personally, I'd more and more consider the need for forEach to be 
> JSTL  compliant as somewhat... annoying.
>
> paul
>
> Le 23 sept. 04, à 17:28, Ben Anderson a écrit :
>
>> I'm new to this list, and developer tasks in Apache projects.  I 
>> found  a bug in
>> jelly's forEach tag, which is not conformant to jstl.  I've tried to  
>> fix it and
>> am close (I think), but it's not functioning exactly as I suspected 
>> it  would.
>> Maybe someone could offer some help.  I want to check the specific  
>> process for
>> this.  Should I enter a bug in bugzilla?  I can then post my patch  
>> there?
>> Also, I've added a couple of files(tests).  Do I just append these?   
>> Somethine
>> like:
>>
>> $cvs diff  -u > site.patch
>> $echo "src/test/org/apache/commons/jelly/core/TestForEachTag.java" 
>> >>  site.patch
>> $cat src/test/org/apache/commons/jelly/core/TestForEachTag.java >>  
>> site.patch
>> $echo "src/test/org/apache/commons/jelly/core/testForEachTag.jelly"  
>> >>site.patch
>> $cat src/test/org/apache/commons/jelly/core/testForEachTag.jelly >>  
>> site.patch
>>
>> also, like I said this patch isn't complete.  What I'm doing is  
>> creating an
>> anonymous inner class and setting that in the context.  The jelly  
>> script
>> recognizes the object, but doesn't proper evaluate it's methods:
>> <!-- this evaluates correctly -->
>> <j:out value="${myClass.class}"/>
>>
>> <!-- the class contains a method getProp1()
>>      but it isn't evaluating correctly -->
>> <j:out value="${myClass.prop1}"/>
>>
>> I'm thinking this may have something to do with it being an 
>> anonymous  inner
>> class.  Eyeballing my patch would be much easier than me explaining  
>> here, so I
>> won't go into much detail.  I'm just curious as to the next step I  
>> should take.
>>
>> Thanks,
>> Ben
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message