Velocity
  1. Velocity
  2. VELOCITY-612

Support for #break directive inside foreach loops (includes a patch)

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6
    • Component/s: Engine
    • Labels:
      None

      Description

      Here's a small patch that adds support for #break directive that can be used to break foreach-loops.

      Catch: #break does not verify that it is inside a foreach loop. If it is not, a RuntimeException of type BreakException is thrown during rendering and not caught properly. Testcases are also quite laughable but the directive seems to work OK.

      1. ForeachBreakTestCase.java
        3 kB
        Nathan Bubna
      2. velocity-1.6-dev-break-directive.patch
        10 kB
        Jarkko Viinamäki

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              Jarkko Viinamäki
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development