Results 1 to 2 of 2
  1. #1
    chennee72 is offline Member
    Join Date
    Aug 2008
    Posts
    3
    Rep Power
    0

    Default how to do conditional looping?

    <c:forEach var="i" begin="5" end="0">
    <c:set var="i" value="${i-1}" />
    <cout value="${i}" />
    </c:forEach>

    the code above does not display any output

    My expected output is: 4 3 2 1

    Please tell me what is the problem? And how to fix it

  2. #2
    sagarbirari is offline Member
    Join Date
    Sep 2008
    Posts
    17
    Rep Power
    0

    Default

    try following code

    <c:forEach var="i" begin="5" end="0" step="-1">
    <c:out value="${i}" />
    </c:forEach>

    Regards

Similar Threads

  1. Looping problem
    By Tanilo in forum New To Java
    Replies: 1
    Last Post: 08-01-2008, 06:34 AM
  2. JFrame Conditional Close
    By hemanthjava in forum AWT / Swing
    Replies: 10
    Last Post: 06-29-2008, 07:49 AM
  3. Looping ArrayList
    By hai789 in forum Web Frameworks
    Replies: 5
    Last Post: 05-07-2008, 03:55 AM
  4. Java Looping and decision
    By susan in forum AWT / Swing
    Replies: 1
    Last Post: 08-07-2007, 04:29 AM
  5. looping a function
    By Username in forum New To Java
    Replies: 2
    Last Post: 07-30-2007, 05:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •