Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

forEach tag begin equals end issue

 
Karthik Rajendiran
Ranch Hand
Posts: 217
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends
I have a condition issue in foreach tag

<c:forEach items="${size}" end="3" >
<cut value="HELLO"/>
</c:forEach>

If the begin is equal to end tag, the loop doesnt execute.
If i give begin as 2 and end as 3, the loop executes twice,but i want it to execute one time, in such case

How to do this with foreach

Kindly help
 
Bosun Bello
Ranch Hand
Posts: 1510
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to check out the jstl reference to see exactly how it handles it.
 
Shrenik Sakriya
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pls. give end="0" ... Should work . But even if you give begin & end same at least one should be printed.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shrenik Sakriya:
Pls. give end="0" ...


"Pls" is not a word. Please use only real words such as "please" when posting to the forums.
 
Karthik Rajendiran
Ranch Hand
Posts: 217
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,

<c:set var="x" value="3"/>
<c:forEach begin="${x}" end="3">
<cut value="${x}"/>
</c:forEach>

Surprisingly,code inside the body doesnt even execute once.
 
Karthik Rajendiran
Ranch Hand
Posts: 217
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends
As per jakarta implementation, the code is works with one time entry
I am using resin 2.x with jakartha jstl.
I am getting that issue in resin and not in tomcat.
Anybody can help ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem does not manifest itself in resin 3 with its builtin JSTL implementation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic