You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bruno Klava <bk...@gmail.com> on 2013/09/05 22:40:42 UTC
Possible bug in URL validator
Hi folks,
in Struts 2.3.15 the form-close-validate.ftl template was updated to use
the regex field, but there is no such field in
com.opensymphony.xwork2.validator.annotations.UrlValidator neither a
default value for it
in com.opensymphony.xwork2.validator.validators.URLValidator (like is done
in com.opensymphony.xwork2.validator.validators.EmailValidator).
Or am I missing something?
My current workaround: override the form-close-validate.ftl setting the
regex directly in the template code.
A better solution would be: make
com.opensymphony.xwork2.validator.validators.URLValidator
extends com.opensymphony.xwork2.validator.validators.RegexFieldValidator
and set a default value for regex in
com.opensymphony.xwork2.validator.validators.URLValidator.
An interesting improvement would be to expose the regex field in the
UrlValidator and EmailValidator annotations to be set in custom scenarios.
Thanks in advance,
Bruno
Re: Possible bug in URL validator
Posted by Bruno Klava <bk...@gmail.com>.
https://issues.apache.org/jira/browse/WW-4198
On Tue, Sep 10, 2013 at 5:09 AM, Lukasz Lenart <lu...@apache.org>wrote:
> 2013/9/5 Bruno Klava <bk...@gmail.com>:
> > Hi folks,
> >
> > in Struts 2.3.15 the form-close-validate.ftl template was updated to use
> > the regex field, but there is no such field in
> > com.opensymphony.xwork2.validator.annotations.UrlValidator neither a
> > default value for it
> > in com.opensymphony.xwork2.validator.validators.URLValidator (like is
> done
> > in com.opensymphony.xwork2.validator.validators.EmailValidator).
> >
> > Or am I missing something?
>
> It's a bug - there is no option to set regex in URLValidator as it
> bases on URLUtil and URL directly.
>
> > My current workaround: override the form-close-validate.ftl setting the
> > regex directly in the template code.
> >
> > A better solution would be: make
> > com.opensymphony.xwork2.validator.validators.URLValidator
> > extends com.opensymphony.xwork2.validator.validators.RegexFieldValidator
> > and set a default value for regex in
> > com.opensymphony.xwork2.validator.validators.URLValidator.
> > An interesting improvement would be to expose the regex field in the
> > UrlValidator and EmailValidator annotations to be set in custom
> scenarios.
>
> Please register an issue.
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Bruno Klava
Re: Possible bug in URL validator
Posted by Lukasz Lenart <lu...@apache.org>.
2013/9/5 Bruno Klava <bk...@gmail.com>:
> Hi folks,
>
> in Struts 2.3.15 the form-close-validate.ftl template was updated to use
> the regex field, but there is no such field in
> com.opensymphony.xwork2.validator.annotations.UrlValidator neither a
> default value for it
> in com.opensymphony.xwork2.validator.validators.URLValidator (like is done
> in com.opensymphony.xwork2.validator.validators.EmailValidator).
>
> Or am I missing something?
It's a bug - there is no option to set regex in URLValidator as it
bases on URLUtil and URL directly.
> My current workaround: override the form-close-validate.ftl setting the
> regex directly in the template code.
>
> A better solution would be: make
> com.opensymphony.xwork2.validator.validators.URLValidator
> extends com.opensymphony.xwork2.validator.validators.RegexFieldValidator
> and set a default value for regex in
> com.opensymphony.xwork2.validator.validators.URLValidator.
> An interesting improvement would be to expose the regex field in the
> UrlValidator and EmailValidator annotations to be set in custom scenarios.
Please register an issue.
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org