aspose file tools*
The moose likes Struts and the fly likes Error using Struts Validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error using Struts Validator" Watch "Error using Struts Validator" New topic
Author

Error using Struts Validator

Marcos Gomes
Greenhorn

Joined: Jul 02, 2007
Posts: 6
Hi guys,

I'm trying to use validator, but Tomcat throws the following exception:

18/04/2008 10:15:24 org.apache.struts.validator.ValidatorForm validate

SEVERE: No such validation method: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.http.HttpServletRequest)

org.apache.commons.validator.ValidatorException: No such validation method: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.http.HttpServletRequest)

at org.apache.commons.validator.ValidatorAction.loadValidationMethod(Val
idatorAction.java:604)

...


*************************************************
The file validator-rules.xml seems to be correct:
*************************************************

<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">

<form-validation>

<global>

<validator name="required"
classname="org.apache.struts.validator.FieldChecks"
method="validateRequired"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
msg="errors.required"/>

// other definitions

</global>

</form-validation>

*************************************************
And this is my validation.xml file:
*************************************************

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">

<form-validation>
<formset>
<form name="ContactForm">
<field property="contact.company" depends="required">
<msg name="required" key="lilldep.error.company"/>
</field>
<field property="contact.name" depends="required">
<msg name="required" key="lilldep.error.name"/>
</field>
<field property="contact.email" depends="required">
<msg name="required" key="lilldep.error.email"/>
</field>
</form>
</formset>
</form-validation>

*************************************************

Please,

Somebody has already had this kind of problem and would help me to solve it ??

Thanks,

Marcos
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
This looks like a problem that might occur if you have jar files from one Struts version and TLDs from another. Make sure that all the artifacts you reference in your project come from the same Struts download.


Merrill
Consultant, Sima Solutions
bhushanbrb bhange
Greenhorn

Joined: Sep 28, 2010
Posts: 4
:jumpingjoy:


-
Bhushan
bhushanbrb bhange
Greenhorn

Joined: Sep 28, 2010
Posts: 4
bhushanbrb bhange wrote:@Merrill
Consultant,can you please elaborate ?
bhushanbrb bhange
Greenhorn

Joined: Sep 28, 2010
Posts: 4
bhushanbrb bhange wrote:
bhushanbrb bhange wrote:@Merrill
Consultant,can you please elaborate ?


bhushanbrb bhange
Greenhorn

Joined: Sep 28, 2010
Posts: 4

Please Help me to solve above said error by 1st person (Class Not Found)
 
 
subject: Error using Struts Validator