Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4893

The last item of ForEachStatus.last is false if end can't be reached by step

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.6.0
    • 8.0.0
    • Databind 2

      Steps to Reproduce

      https://zkfiddle.org/sample/3b89sim/1-ForEachStatus
      Check the result

      Current Result

      The last is always false.

      Expected Result

      Only the last row is true, otherwise false.

      Debug Information

      public boolean isLast() {
      	return getIndex() == getEnd();
      }
      

      The expression is always false since the end value can't be reached. 18 != 20.

      https://github.com/javaee/jstl-api/blob/jstl-1.2/api/src/main/java/javax/servlet/jsp/jstl/core/LoopTagSupport.java#L555
      JSTL handles this case properly

      Workaround

            rudyhuang rudyhuang
            rudyhuang rudyhuang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 1 hour Remaining Estimate - 3 hours
                3h
                Logged:
                Time Spent - 1 hour Remaining Estimate - 3 hours
                1h