This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error using Struts Validator

 
Marcos Gomes
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
bhushanbrb bhange
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
:jumpingjoy:
 
bhushanbrb bhange
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bhushanbrb bhange wrote:@Merrill
Consultant,can you please elaborate ?
 
bhushanbrb bhange
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bhushanbrb bhange wrote:
bhushanbrb bhange wrote:@Merrill
Consultant,can you please elaborate ?


 
bhushanbrb bhange
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Please Help me to solve above said error by 1st person (Class Not Found)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic