File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

forEach and hasNext()

 
Max Rahder
Ranch Hand
Posts: 177
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I translate this into forEach? The part I can't figure out is the code that omits the delimiter for the last item:

Java version:

This sample prints something like: "Groucho, Harpo, Chico"



JSTL version:

How do I put the "has next" test inside the forEach tag?

This sample prints something like: "Groucho, Harpo, Chico, "
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the varStatus attribute of the forEach tag.
 
Max Rahder
Ranch Hand
Posts: 177
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works great. Thanks for the tip.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic