Did it this way. Passed field names via the tag, then obtained values inside
the validator class using getFieldValue(fieldName, object).
Thank you for suggestions.
stanlick wrote:
Rather than pass this, that and the other parameter(s) to your validator,
why not just retrieve what you need
2009/5/19 manub e.bla...@reply.it:
I'm trying to write a custom field validator which needs other fields to
validate the field I need to validate. How can I pass field values (and not
static params) to a field validator in the validation xml? I'm using Struts
2.1.6.
Did you try
Yes, I did. But in the action the string takes the value ${field} and not
the field value.
Lukasz Lenart wrote:
2009/5/19 manub e.bla...@reply.it:
I'm trying to write a custom field validator which needs other fields to
validate the field I need to validate. How can I pass field values
2009/5/20 manub e.bla...@reply.it:
Yes, I did. But in the action the string takes the value ${field} and not
the field value.
Frankly, I don't understand, are you trying to pass data from
validator xml configuration to action?
Regards
--
Lukasz
http://www.lenart.org.pl
Lukasz Lenart wrote:
Frankly, I don't understand, are you trying to pass data from
validator xml configuration to action?
I've written a custom field validator, which needs other field values to
validate his field. I need a way to pass that values to that field
validator.
--
View
2009/5/20 manub e.bla...@reply.it:
I've written a custom field validator, which needs other field values to
validate his field. I need a way to pass that values to that field
validator.
Did you try to use param tag as below?
field name=employee.employeeType
field-validator type=expression
Hi all,
I'm trying to write a custom field validator which needs other fields to
validate the field I need to validate. How can I pass field values (and not
static params) to a field validator in the validation xml? I'm using Struts
2.1.6.
Thank you.
--
View this message in context:
http
Thanks Dave,
In order to dispaly the error message if we give the whitespace infront of
the number , we need to set trim=false.
I sloved this problem by setting trim=false for regex validation. Below is
the snippet.
Thanks a lot for you input.
field name=caseNumber
field-validator
Hi all,
Do anybody have an idea why this is not working.
There is validation for a numeric field which is a string in the action ,
The validation is through regular expression as show below.
field name=caseNumber
field-validator type=requiredstring
messagePlease enter
Siddiq Syed wrote:
Do anybody have an idea why this is not working.
There is validation for a numeric field which is a string in the action ,
The validation is through regular expression as show below.
field name=caseNumber
field-validator type=requiredstring
.
There is validation for a numeric field which is a string in the action ,
The validation is through regular expression as show below.
field name=caseNumber
field-validator type=requiredstring
messagePlease enter a case number/message
/field-validator
field-validator
Siddiq Syed wrote:
I am searching for the regular expression, which ignore white spaces but no
sucess so far.
Any idea ?
...
According to [1] (which was the top hit when I searched for java
+regular expression), \s matches any whitespace character. * means 0
or more occurrences. So \s*
for this.
Thanx in advance... Jigar
--
View this message in context:
http://www.nabble.com/URGENT-%3A--Unable-to-retain-request-Attributes-after-the-validator-framework-thraws-an-Error...-tp23011346p23011346.html
Sent from the Struts - User mailing list archive at Nabble.com
Hi All,
I was reading the Struts validator API and i
tried all kinds of forums and googling for days to no avail.
How do I use the validator for nested vector validation. Here's my attempt but it doesn't seem to work.
field indexedListProperty
I need to fetch a locale specific string for an evaluation and cannot get
the syntax worked out:
field name=title
field-validator type=expression
param name=expression
!title.toUpperCase().equals( getText(titleMatch) )
/param
Is there a way to avoid hard coding limits into a validator? Take for
instance the IntRangeFieldValidator. It has a min and max property that are
populated from the XML as per:
field name=ageLimit
field-validator type=int
0
I have encountered a validation that seems to disrupt the S2 request life
cycle. If I have the following validation and foo is not found on the
stack, I do not get a result!
validators
field name=name
field-validator type=expression
foo.startsWith
I am using struts 1.3.8 and I have a form field of type
org.apache.struts.upload.FormFile. I would like to validate the
field's size with a custom struts validator. To get the field's value,
i have used for a text field the next code:
String value = ValidatorUtils.getValueAsString(bean
startDate;
public Date getStartDate() { return startDate; }
public void setStartDate(Date startDate) { this.startDate = startDate; }
and the validation file part :
field name=startDate
field-validator type=required
message key=required/
/field-validator
find
the location of error prone code in your JSP file.
-Original Message-
From: UITOT [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 25, 2008 2:52 PM
To: user@struts.apache.org
Subject: Problem is using struts 1.2.9 validator
Hello Experts ,
I am facing one very
Hello Experts ,
I am facing one very strange problem in struts 1.2.9
validator. I have used validator in almost all JSPs of my project but it is
giving error only for one particular JSP , rest are working fine. As soon as
I add an entry for that jsp in validator.xml that form
What is the error?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Is there a way to get hold of the Session object from inside a Validator
or TypeConverter?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--- On Wed, 11/19/08, David C. Hicks wrote:
Is there a way to get hold of the Session object from inside
a Validator or TypeConverter?
Why would you want to? That smells like an unnecessary dependency.
Dave
-
To unsubscribe
Should I take that as a no ?
Dave Newton wrote:
--- On Wed, 11/19/08, David C. Hicks wrote:
Is there a way to get hold of the Session object from inside
a Validator or TypeConverter?
Why would you want to? That smells like an unnecessary dependency.
Dave
of the Session object from inside
a Validator or TypeConverter?
Why would you want to? That smells like an unnecessary dependency.
Dave
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
] wrote:
Should I take that as a no ?
Dave Newton wrote:
--- On Wed, 11/19/08, David C. Hicks wrote:
Is there a way to get hold of the Session object from inside
a Validator or TypeConverter?
Why would you want to? That smells like an unnecessary dependency.
Dave
2008/10/14 Néstor Boscán [EMAIL PROTECTED]:
I'm using the validator frame in Struts 2.0.11.2. When the validator
framework fails I need to call the input method to load some combo data. But
the validator framework automatically calls the input result. If I chain
that input result
Boscán [EMAIL PROTECTED]:
I'm using the validator frame in Struts 2.0.11.2. When the validator
framework fails I need to call the input method to load some combo data.
But
the validator framework automatically calls the input result. If I chain
that input result with the input method I
--- On Wed, 10/15/08, Néstor Boscán wrote:
But the prepare method will be called if a validation error
happens or not. If a validation error happens I want to load the combo
data, but if not I don't need to load that data.
You can also use prepareXxx, where Xxx is the method name.
But if you
Hi
I'm using the validator frame in Struts 2.0.11.2. When the validator
framework fails I need to call the input method to load some combo data. But
the validator framework automatically calls the input result. If I chain
that input result with the input method I loose the fieldErrors
Don't know if it helps you, but Hibernate Validator has a credit card
validator. It will work with JPA providers other than just Hibernate.
On Thu, Aug 21, 2008 at 10:39 AM, Gundersen, Richard
[EMAIL PROTECTED] wrote:
Cheers Dave
I'll dig around and see if theres a good open source
: Wednesday, August 27, 2008 3:47 PM
To: Struts Users Mailing List
Subject: Re: Credit card validator
Don't know if it helps you, but Hibernate Validator has a credit card
validator. It will work with JPA providers other than just Hibernate.
On Thu, Aug 21, 2008 at 10:39 AM, Gundersen, Richard
[EMAIL
Hello,
I am trying to enforce BigDecimal number format with regex validator but
validation simply does nothing. If I apply the same validator to the String
property, validator works but for some reason does not work with BigDecimal.
I guess the reason is that validation is applied to converted
format with regex validator but
validation simply does nothing. If I apply the same validator to the String
property, validator works but for some reason does not work with BigDecimal.
I guess the reason is that validation is applied to converted BigDecimal
object but not on the string which user
ndario wrote:
Is there any way to validate the string before conversion to BigDecimal?
The right (and default) way of handling conversion errors is to
use the Conversion Error Interceptor:
http://struts.apache.org/2.x/docs/conversion-error-interceptor.html
There is no converter for
to give a warning that format is incorrect.
I guess that cannot be done with regex validator and BigDecimal?
--
View this message in context:
http://www.nabble.com/regex-validator-and-BigDecimal-tp19142200p19145282.html
Sent from the Struts - User mailing list archive at Nabble.com
Sorry if I'm missing something obvious, but can someone tell me if
there's a credit card validator in Struts 2?
There's one in Struts 1, and in Struts 2 I found creditCard.js, which
uses the Luhn algorithm, but I cant figure out a) how to use it or b) if
there is a corresponding annotation
--- On Thu, 8/21/08, Gundersen, Richard wrote:
can someone tell me if there's a credit card validator in Struts 2?
Not that I know of; the creditCard.js you're referring to is part of Dojo.
Dave
-
To unsubscribe, e-mail
Manchester
M2 3LS
-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2008 3:17 PM
To: Struts Users Mailing List
Subject: Re: Credit card validator
--- On Thu, 8/21/08, Gundersen, Richard wrote:
can someone tell me if there's a credit card validator
Hi,
Seeing the file form-close-validate.ftl (in xhtml theme) I see that
there is no javascript code for the date validator.
Seems like a straightforward addition.
Or is there some error condition or limitation that I'm not aware of?
Regards,
Gabriel
Hi,
Try to comment such entry for Validator plugin and check again, do you
have any logs from your container? Maybe the problem is elsewhere?
Regards
--
Lukasz
http://www.lenart.org.pl/
-
To unsubscribe, e-mail: [EMAIL
Lukasz Lenart escribió:
Hi,
Try to comment such entry for Validator plugin and check again, do you
have any logs from your container? Maybe the problem is elsewhere?
Regards
The validator-rules.xml validations.xml are located under the correct
path /WEB-INF/, as specified in the struts
Check this
http://issues.apache.org/struts/browse/STR-2862?focusedCommentId=37312#action_37312
Maybe either you have duplicated commons-validator.jar or in wrong version?
Regards
--
Lukasz
http://www.lenart.org.pl/
-
To
-validator 1.3.1. as shown in
this link?
http://mvnrepository.com/artifact/commons-validator/commons-validator/1.3.1
I´ve been googling around but didn´t see any clues.
Regards,
-
To unsubscribe, e-mail: [EMAIL PROTECTED
--- On Tue, 7/15/08, Dani [EMAIL PROTECTED] wrote:
Should I update the depencies of commons-validator 1.3.1.
as shown in this link?
Well yes; you can't just update a library and assume that it will work without
its dependencies.
Dave
15-jul-2008 15:06:33 org.apache.commons.digester.Digester fatalError
GRAVE: Parse Fatal Error at line -1 column -1: Premature end of file.
org.xml.sax.SAXParseException: Premature end of file.
You should also change dtd headers for validator-rules.xml and
validations.xml to reflect new common
Hi again,
After updating all the dependencies and changing the DTD for the
validation.xml and validation-rules.xml:
!DOCTYPE form-validation PUBLIC -//Apache Software Foundation//DTD
Commons Validator Rules Configuration 1.3.0//EN
http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd;;
I
As I remember, there is a bug with this, out dtd to WEB-INF and add
reference to it
http://www.developerdotstar.com/community/node/472
Regards
--
Lukasz
http://www.lenart.org.pl/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
OMG, this is an EPIC FAIL : )
Yes, i have saved and referenced it in WEB-INF.
Best regards,
- Original Message -
From: Lukasz Lenart [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, July 15, 2008 7:23 PM
Subject: Re: Validator plugin error
As I
Hi,
I´m trying to use Struts 1.2 Validator plugin. I guess something in
struts-config.xml is missing or wrong. If I add the necessary code to use the
plugin validator:
plug-in classname=org.apache.struts.validator.ValidatorPlugIn
set-property
property=pathnames
value=/WEB-INF
Hi all,
I've got a form bean for a user which has a field username (duuhhh:)
We use a mask of ^[a-zA-Z_0-9-]*$. Is there a way I can show the
valid characters to the user? Currently the error message in
ApplicationResources properties is:
errors.invalid={0} is invalid.
and the xdoclet tags are
No-reply? :(
However, I solved. Now all works well.
**
SERVER-SIDE
**
To avoid the deprecated method
Resources.getActionMessage(HttpServletRequest request, ValidatorAction va,
Field field)
I used
Resources.getActionMessage(Validator v, HttpServletRequest request,
ValidatorAction
Now, server-side validation works!
I changed ActionErrors class with ActionMessages class into my java
validation method and into validator-rules.xml.
The only problem is that
Resources.getActionMessage(request, va, field)
method in my custom validator class is deprecated and I don't know how
help me.
Thanks.
cacodemon79 wrote:
Hi, I'm using Struts Validator Framework (Struts 1.3).
Server-side validation works well.
The problem is in client-side validation.
The form name I have to validate is: RegistrazioneUtenteForm.
In my jsp page I have 2 buttons:
1) html:link
href
I'm using Struts 1.3.
I'm trying to write a custom validator to check that 2 fields are identical.
1) I modified my validator-rules.xml by adding my own validator (called
uguale):
**
validator-rules.xml
**
validator name=uguale
classname
Hi,
Struts2 use XWork Validation Framework, so you can use it
http://www.opensymphony.com/xwork/wikidocs/Validation%20Framework.html
Regards
--
Lukasz
http://www.lenart.org.pl/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
.
cacodemon79 wrote:
Hi, I'm using Struts Validator Framework (Struts 1.3).
Server-side validation works well.
The problem is in client-side validation.
The form name I have to validate is: RegistrazioneUtenteForm.
In my jsp page I have 2 buttons:
1) html:link
href
Hi,
Maybe you should install Firebug for Firefox (not working with 3.0)
and debug the JavaScript?
Regards
--
Lukasz
http://www.lenart.org.pl/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Lukasz Lenart wrote:
Maybe you should install Firebug for Firefox (not working with 3.0)
and debug the JavaScript?
A beta version of firebug does work with 3.0 :
http://getfirebug.com/releases/index.html
-Dale
-
To
A beta version of firebug does work with 3.0 :
http://getfirebug.com/releases/index.html
Thanks!
--
Lukasz
http://www.lenart.org.pl/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
javascript alerts.
I can't understand where is the problem.
I hope you can help me.
Thanks.
cacodemon79 wrote:
Hi, I'm using Struts Validator Framework (Struts 1.3).
Server-side validation works well.
The problem is in client-side validation.
The form name I have to validate
wrote:
Hi, I'm using Struts Validator Framework (Struts 1.3).
Server-side validation works well.
The problem is in client-side validation.
The form name I have to validate is: RegistrazioneUtenteForm.
In my jsp page I have 2 buttons:
1) html:link
href=javascript:submitRegistrazioneUtenteForm
Hi,
2008/6/23 cacodemon79 [EMAIL PROTECTED]:
Bingo!
Now it works!
Thanks a lot.
However i can't understand why the onsubmit handler is not triggered by the
submit() function!
Maybe it depends on Web Browser, did you try with others?
Regards
--
Lukasz
http://www.lenart.org.pl/
document.registrazioneUtenteForm.submit())
instead of
eval(document.+nomeForm+.submit())
but the result is the same. The form is submitted but I can't see any
javascript alerts.
I can't understand where is the problem.
I hope you can help me.
Thanks.
cacodemon79 wrote:
Hi, I'm using Struts Validator Framework
Hi, I'm using Struts Validator Framework (Struts 1.3).
Server-side validation works well.
The problem is in client-side validation.
The form name I have to validate is: RegistrazioneUtenteForm.
In my jsp page I have 2 buttons:
1) html:link
href=javascript:submitRegistrazioneUtenteForm
I would like to use the Struts2 validation classes outside of Struts2.
What I would like to do specifically is use the UrlValidator to test a
string to determine if it is a URL and if it is create the link and if
not just display the value. I would like to use the validator for this
since we use
Hi once more,
seems like a struts day to me :)
Anyway, using struts 1.2.4 and XDoclet 1.2.3 is there a way to define an
error message for a form which includes an argument or something?
For example:
/**
* Set name.
*
* @param name the value to set.
*
* @struts.validator
give some string/ char in int field its throwing errors as expected.
any help ???
cheers,
ravi
--
View this message in context:
http://www.nabble.com/required-Int-validator--How-to.-tp17761272p17761272.html
Sent from the Struts - User mailing list archive at Nabble.com
ravi_eze wrote:
hi,
I see that the previous valid int value is being populated when i enter null
in an integer text field. I want to show error in such a case. Any ideas how
to get this done.
The scenario is as follows:
1. When i enter no value in F1: i get validation error asking me to
Say if I have two text fields, one label is Please enter name:, and the
other label is Please enter SSN:. In struts validator framework, if I
need to validate these two fields using required validator, is there any
way to relate the field label to the message? Or does struts validator
support
You define the field label using an argument, i.e.
field property=username depends=required
arg0 key=prompt.username/
/field
So the validator is using the field's label to fill in the message. The
default message for errors.required is:
errors.required={0} is required.
So
hi
i have validate fileds password and re-password must same as expression
using
validator type=expression
passwd eq repasswd
messagePassword and Re-password must be same/message
/validator
when i put this in my *-validator.xml and try to check givin difference
fiield value
gives error like
;
!--
This is a blank Struts configuration file with an example
welcome action/page and other commented sample elements.
Tiles and the Struts Validator are configured using the factory
defaults
and are ready-to-use.
NOTE: If you have a generator tool to create the corresponding Java
action/page and other commented sample elements.
Tiles and the Struts Validator are configured using the factory
defaults
and are ready-to-use.
NOTE: If you have a generator tool to create the corresponding Java
classes
for you, you could include the details
This may be a duplicate. I'm a new user of this list.
I modified the quickstart demo application by adding person.dateOfBirth
and person.age to do some tests with the validators.
I added a an intrange validator on the age and a daterangevalidator
and a regex validator on the date of birth
I modified the quickstart demo application by adding person.dateOfBirth
and person.age to do some tests with the validators.
I added a an intrange validator on the age and a daterangevalidator
and a regex validator on the date of birth plus
additional required validators on the new fields
Hello,
Does struts 2 have a built in validator that will allow me to make sure two
fields match (ie, two password fields). From looking around, it seems that
struts 1 had validatewhen which could be used, but I haven't been able to
find anything for struts 2.
Thanks!
Kelly
--
View
Sure, you can use an ExpressionValidator annotation with an OGNL expression
like this:
@ExpressionValidator(expression = password1.equals(password2), ...)
Cheers,
GB
Kelly.Graus wrote:
Hello,
Does struts 2 have a built in validator that will allow me to make sure
two fields match (ie
--- Kelly.Graus [EMAIL PROTECTED] wrote:
Does struts 2 have a built in validator that will allow me to make sure two
fields match (ie, two password fields). From looking around, it seems that
struts 1 had validatewhen which could be used, but I haven't been able to
find anything for struts 2
Guillaume Bilodeau wrote:
Sure, you can use an ExpressionValidator annotation with an OGNL
expression like this:
@ExpressionValidator(expression = password1.equals(password2), ...)
Cheers,
GB
Thanks for the reply! I'm using field validators, so I did this:
field-validator type
Kelly.Graus wrote:
Thanks for the reply! I'm using field validators, so I did this:
field-validator type=fieldexpression
![CDATA[#password1.equals( password2 )]]
messageThe passwords do not match!/message
/field-validator
Which works perfectly. Thanks
Neither Commons Validator nor Struts knows how to process XML requests
like that out of the box. Assuming Struts 1, the answer is that you will
have to write your own logic to populate the form bean from the XML
request, after which validation can be performed the same as you would
It's a question regarding commons validator api, wherein i am trying to
validate an input request form (xml-request) which contains a collection
of
items...like
OrdersInputRequest
Order
OrderId222/OderId
OrderDate04/04/2004/OrderDate
/Order
Order
OrderId223/OderId
Hello. I am having a problem getting repopulateField to work. In
short, I have added date validation to one of my actions. In my
validation xml file, I have this:
field name=moviereview.reviewdate
field-validator type=conversion short-circuit=true
param name
to one of my actions. In my
validation xml file, I have this:
field name=moviereview.reviewdate
field-validator type=conversion short-circuit=true
param name=repopulateFieldtrue/param
messageDate of Review entered is not a valid date./message
/field
i am using struts for my front end handling of data. now i wish to go for
validator framework for handling form validation given by user, I have put
the validaton.xml and validaton-rules.xml into web-inf and i hav plugged in
the plugin with className and paramnames as the xml files but when my
What version of Struts 1 are you using?
Dave
--- balaji.m.cs [EMAIL PROTECTED] wrote:
i am using struts for my front end handling of data. now i wish to go for
validator framework for handling form validation given by user, I have put
the validaton.xml and validaton-rules.xml into web-inf
Hi, all.
I have a superclass where almost all of the subclasses will require
several validations for a particular field, but one subclass will use
some but not all of those validations. I know that you can add
@SkipValidation to avoid all validators, but is there something that you
can use to
Allen, Daniel wrote:
Hi, all.
I have a superclass where almost all of the subclasses will require
several validations for a particular field, but one subclass will use
some but not all of those validations. I know that you can add
@SkipValidation to avoid all validators, but is there something
in reset()
method of ValidatorForm and build again so IMHO should be safe. But aren't
we missing something?
We still question ourselves Why then isn't struts doing something like that
automatically.
Thanks for all yout comments.
(We are using struts 1.2.9 for our project and Jakarta Common Validator
Hi all,
It seems that my struts application's validator does not work. I've add
plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames
value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml /
/plug-in
to my struts-config.xml and these two files
Finally I found the problem!
I did apply a slight change to the validator.xml yesterday: just added the
following xml header.
!DOCTYPE form-validation PUBLIC
-//Apache Software Foundation//DTD Commons Validator Rules Configuration
1.1//EN
http://jakarta.apache.org/commons/dtds/validator_1_1
Hi all, I'm trying to make a password field be at least 6 characters in
length but the check doesn't seem to work.
Here's my code:
/**
* @struts.validator type=required,minlength,maxlength,mask
*
* @struts.validator-var name=minlength value=5
* @struts.validator-var
To: Struts Users Mailing List
Subject: RE: short-circuit=true not working in field validator
--- Chamara Gunaratne [EMAIL PROTECTED] wrote:
s:form action=ApplicationSubmitAction.do validate=true
Ah.
I'm not sure that the short-circuiting behavior works with client-side
validation, although it probably
Hmmm, I tried setting the log level to DEBUG and it yielded a mass of
logging entries, but nothing that was particularly insightful. Grepping on
short-circuit, validator, etc didn't bring out anything useful.
Very strange problem, everything else seems to be working fine and I cannot
find
Please repost your configs, JSP, and action; I'll look at it again.
Dave
--- Chamara Gunaratne [EMAIL PROTECTED] wrote:
Hmmm, I tried setting the log level to DEBUG and it yielded a mass of
logging entries, but nothing that was particularly insightful. Grepping on
short-circuit, validator
Dave:
Thank you, here's the files:
ApplicationAction-validation.xml:
!DOCTYPE validators PUBLIC -//OpenSymphony Group//XWork Validator
1.0.2//EN
http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd;
validators
field name=user.firstName
field-validator type
--- Chamara Gunaratne [EMAIL PROTECTED] wrote:
s:form action=ApplicationSubmitAction.do validate=true
Ah.
I'm not sure that the short-circuiting behavior works with client-side
validation, although it probably should. I don't see any code in the
generated JavaScript, however, that would enforce
:
validators
field name=user.firstName
field-validator type=required short-circuit=true
messagePlease enter your first name./message
/field-validator
field-validator type=regex short-circuit=true
param name=expression^[a-z
201 - 300 of 1759 matches
Mail list logo