You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2015/10/03 13:17:27 UTC

[jira] [Commented] (WICKET-5987) StringLengthValidator does not validate, but cuts off input

    [ https://issues.apache.org/jira/browse/WICKET-5987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14942234#comment-14942234 ] 

Martin Grigorov commented on WICKET-5987:
-----------------------------------------

I was going to add protected method that the application developer could override and suppress this behavior, but I see I'll have to the same for 'minlength'...
I so no reason to make it so configurable/complex - the application developer could just override #onComponentTag(). 
Just use the constructors, e.g. 'new StringValidator(min, max)', instead of the static factory methods.

Changing StringValidator to not write these attributes is a rather big behavior change that may break applications in production. We can do it for Wicket 8.x if you think this is the better default.

> StringLengthValidator does not validate, but cuts off input
> -----------------------------------------------------------
>
>                 Key: WICKET-5987
>                 URL: https://issues.apache.org/jira/browse/WICKET-5987
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 7.0.0
>         Environment: ubuntu 14.04 LTS, Chrome 45, Java 8
>            Reporter: Rob Audenaerde
>            Assignee: Martin Grigorov
>         Attachments: stringlenghttest.zip
>
>
> I have a change-password-page with a PasswordField with a StringValidator.lengthBetween( 3, 20 ).
> I ran into an error where I could paste a long password (>20 chars), and Wicket not throwing errors, but cutting the password to length 20.
> Wicket version: 7.0
> Chrome: 45
> The maxlength is rendered as attribute on the element.
> <input id="password" type="password" name="password" value="" maxlength="20" minlength="3">



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)