I'm creating a custom validator to enforce a = relationship between 2 date fields and
am having a problem.
A validator method gets a Field arg for the field with which it's associated in
validation.xml, but I need to also get the Field object for the other date field. I
need this so that I can
, but that's just an assumption...
-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 10:18 AM
To: Struts Users Mailing List
Subject: Re: custom validator question
Specify the second field as var
field property=myFirstDate depends=date
I wasn't aware of it--I'm using Struts 1.1. I'll check it out.
Thanks.
-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 10:20 AM
To: Struts User Jakarta
Subject: Re: custom validator question
Also, what about using the existing
I had a custom validator 'futureDate' for which I needed to pass in a
date and time which were 2 different form fields, to check that the date
was in the future.
I passed 2 different values into a custom parameter using two args and
vars:
form name=form
field property=emailDate depends=required
: Re: custom validator question
Specify the second field as var
field property=myFirstDate depends=date,dateCompare
var
var-namedatePattern/var-name
var-valuedd/MM//var-value
/var
var
var-namecompareDate/var-name
var-valuemySecondDate
[IT] [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 2:54 PM
Subject: custom validator question
I'm creating a custom validator to enforce a = relationship between 2 date
fields and am having a problem.
A validator method gets a Field arg for the field with which it's
: Pingili, Madhupal
Sent: Wednesday, February 11, 2004 2:19 PM
To: '[EMAIL PROTECTED]'
Subject: Need help on making Custom Validator work
Hi All,
I have developed a validator for a special validation.
I have debug statements in this class and I enabled
the validator and struts.action
Hi All,
I have developed a validator for a special validation.
I have debug statements in this class and I enabled
the validator and struts.action classes logging level to DEBUG.
When I type an invalid field in my form and click on search button,
the action gets invoked and I see all the messages
if it shows you just blank page then something is *null* somewhere
-Original Message-
From: Pingili, Madhupal [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 12:49 AM
To: '[EMAIL PROTECTED]'
Subject: Need help on making Custom Validator work
Hi All,
I have developed
PROTECTED]
Sent: Thursday, January 22, 2004 3:15 PM
To: '[EMAIL PROTECTED]'
Subject: [Validator] Custom Validator Fails to Return to JSP
I've used the 'comparing two fields' example from Validator
for a while now
without any problem. When I brought down the 20040106
nightly build, I
noticed
I've used the 'comparing two fields' example from Validator for a while now
without any problem. When I brought down the 20040106 nightly build, I
noticed that several methods had been deprecated, so I dutifully changed
things over:
From:
public static boolean comparePasswords(Object
in custom validator
I added the commons validator to my Struts implementation. The
out-of-the-box stuff is working just fine. However, I added the following
custom validator:
public class BarnmanValidator implements Serializable {
public static boolean validateEmailAddress(Object bean
I added the commons validator to my Struts implementation. The
out-of-the-box stuff is working just fine. However, I added the following
custom validator:
public class BarnmanValidator implements Serializable {
public static boolean validateEmailAddress(Object bean, Field field) {
[etc, etc
-
From: Rob van Oostrum [mailto:[EMAIL PROTECTED]
Sent: November 14, 2003 6:11 PM
To: [EMAIL PROTECTED]
Subject: NoClassDefFoundError in custom validator
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail
Hi Everyone,
I am currently trying to create a custom validator for a file upload form and am
unclear as to how to retrieve the value of the File field. I would like to have the
object as a FormFile so that I can perform further checks on the file. Are there any
examples available to peruse
for me :)
HTH,
Erez
-Original Message-
From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 6:05 PM
To: Struts (E-mail)
Subject: Custom Validator
Hey everyone,
I've got some nice custom validations working using the validation
framework. However
Hey everyone,
I've got some nice custom validations working using the validation
framework. However, I'm having a hard time with one seemingly imple issue.
In the validation method in my custom validation class, how do I get the
value of the field I'm validating?
I found one example that did
I have the standard validation working just fine. I have attempted to
branch out to use a custom validator for making sure that passwords follow a
certain set of rules. The custom validation method does not get called. I
set the logging to debug, but the output only confirmed that my method
Could it be that it is failing required or minlength
first and therefore isn't getting to your method?
-Original Message-
From: Brown, Melonie S. - Contractor [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 12:32 PM
To: '[EMAIL PROTECTED]'
Subject: Custom Validator not being
Message
Subject: RE: Custom Validator not being called
Date: Tue, 27 May 2003 12:31:04 -0400
From: Bailey, Shane C. [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
Newsgroups: gmane.comp.jakarta.struts.user
Could it be that it is failing required or minlength
first
:(
-Original Message-
From: Brown, Melonie S. - Contractor [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 1:20 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Custom Validator not being called
I could live with that. :)
The problem is that the custom validation isn't being called when
I am attempting to get this identical field validator working and
after a long night I feel as if I am almost there. However, this is
the latest ERROR reported when the field is undergoing validation.
java.lang.IllegalAccessException: Class
ERROR org.apache.commons.validator.Validator -
Dan Allen ([EMAIL PROTECTED]) wrote:
I am attempting to get this identical field validator working and
after a long night I feel as if I am almost there. However, this is
the latest ERROR reported when the field is undergoing validation.
java.lang.IllegalAccessException: Class
ERROR
Caused by: java.lang.NoClassDefFoundError:
What's the structure of your .war?
Two possible solutions:
A) Put the commons (or even all Struts related) libraries in your
$jboss/server/$setup/lib.
B) Nest your .war inside a .sar that contains all libraries at the top
level.
--
Eric Jain
/validation.xml
/WEB-INF/validator-rules.xml
/WEB-INF/custom-validator-rules.xml
/WEB-INF/lib/commons-beanutils.jar
/WEB-INF/lib/commons-collections-2.0.jar
/WEB-INF/lib/commons-digester.jar
/WEB-INF/lib/commons-logging.jar
/WEB-INF/lib/commons-validator.jar
/WEB-INF/lib/jakarta-oro.jar
/WEB-INF/lib
Hi all,
I have Validator operational with two-password validation along the lines of
what is in the developer guide. I've found that the custom validator
function can be found when the setup is running under standalone Tomcat
4.0.x, but not when that tomcat is running under JBoss, I get
Hello all,
I've given this one a pretty good effort, having hacked at it a while,
looked at the lists, read the chapters from several of the books, and
still
don't seem to have it quite right.
I set out to write my own custom validator, using the example of
requireIdentical,
to make sure when
Okay, here ya go. As usual, change the variables, methods and params to
suit your requirements.
--
Usage example (see the TLD for full list -
and/or add your own. Be sure to reflect any
changes in the TLD in the class as well):
partner:validation baseName=name isNotNull=true
package com.tessco.partner.web.validation;
//java imports
import java.util.Map;
import java.util.List;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.StringTokenizer;
//javax imports
import javax.servlet.ServletRequest;
import
package com.tessco.partner.web;
// java.sql import
import java.sql.Timestamp;
import java.util.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;
//javax imports
import javax.servlet.http.HttpServletRequest;
//struts imports
import org.apache.struts.action.ActionForm;
30 matches
Mail list logo