Chris Poulsen created TAP5-2513:
-----------------------------------
Summary: Specifying a regexp validation rule where the pattern
contains a comma breaks
Key: TAP5-2513
URL: https://issues.apache.org/jira/browse/TAP5-2513
Project: Tapestry 5
Issue Type: Bug
Affects Versions: 5.4
Reporter: Chris Poulsen
I tried to do the following:
{code}
@Component( parameters = { "value=value",
"validate=regexp=[0-9a-fA-F]{3,6}" } )
private TextField myField;
{code}
Tapestry complains about the regexp pattern not being valid (in particular that
the "6" is unexpected. This is due to the parser in (FieldValidatorSourceImpl)
expecting that comma only exist to separate validator rules.
Similar issues seem to have already been fixed for the other ways to express
regexp constraints (TAP5-520).
It seems that there are several different ways implemented to extract the
validation rules currently, I tried replacing the code in
FieldValidatorSourceImpl with the code used in
(ValidateAnnotationConstraintGenerator / FieldValidatorDefaultSourceImpl ) -
It seems to produce the correct results at runtime, but will probably require
some unit test adjustments, as the char-by-char parser have been replaced (it
looks like a decent error message is still produced when an invalid pattern is
specified, but it is another place that returns the error).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)