You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/08/13 16:47:41 UTC

[Bug 44284] Support java.lang.Iterable in c:forEach tag

https://issues.apache.org/bugzilla/show_bug.cgi?id=44284

--- Comment #2 from Christopher Schultz <ch...@christopherschultz.net> ---
The JSTL spec requires that "items" that are of type "array",
java.util.Collection, java.util.Iterator, java.util.Enumeration, java.util.Map,
and String be supported by forEach implementations. I don't see anything that
suggests that support for /other/ types should be prohibited.

My only concern would be that of portability of the JSP that uses an
implementation that supports Iterable: other implementations may not support
it, so the Tomcat implementation would effectively fragment the standard.

It should be easy write a method that accepts an Iterable and returns an
Iterator, and then wrap your Iterable objects in a call to that method before
passing it into the <c:forEach> tag. That seems like a more portable solution.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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