struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Klava <bkl...@gmail.com>
Subject Possible bug in URL validator
Date Thu, 05 Sep 2013 20:40:42 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message