Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-520

Using regular expressions with the @Validate annotation causes odd parse errors if the regexp includes common characters (including commas)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.18
    • Fix Version/s: 5.1.0.1
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Try adding this field to your form:

      @Validate("regexp=^([a-zA-Z0-9]

      {2,4}

      )+$")
      private String somefield;

      Page will fail to render with exception saying:

      Render queue error in BeginRender[mypage.somefield]: Failure reading parameter 'validate' of component mypage.somefield: Coercion of ^([a-zA-Z0-9]{2 to type java.util.regex.Pattern (via String --> java.util.regex.Pattern) failed: Unclosed counted closure near index 15 ^([a-zA-Z0-9]{2 ^

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                igor.drobiazko Igor Drobiazko
                Reporter:
                chaostya Konstantin Miklevskiy
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: