aspose file tools
The moose likes Struts and the fly likes maxlength validation not working Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "maxlength validation not working" Watch "maxlength validation not working" New topic
Author

maxlength validation not working

Pradeep Swaminathan
Greenhorn

Joined: Aug 25, 2005
Posts: 8
Hi,

I am trying to use the validation framework in my application. I have a jsp page with one field to be validated for lenght. when i implement the maxlength validation, it doesn't work. But the "required ' field validation works...

I have tried the changing the struts.jar, validation-rules.xml etc... Still same...

<?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>
<!-- An example form -->
<form name="MismatchEDIForm">
<field property="isa_date" depends="maxlength">
<arg0 key="mismatchpage.date"/>
<arg1 key="${var:maxlen}" resource="false"/>
<var>
<var-name>maxlen</var-name>
<var-value>6</var-value>
</var>
</field>
</form>
</formset>
</form-validation>


Pradeep
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Here are two examples that I pulled out of my validation.xml file. The first one uses both required and maxlength. The second just uses maxlength. Note the use of the "name" attribute on the arg1 tag. That might be your problem.


- Brent
Pradeep Swaminathan
Greenhorn

Joined: Aug 25, 2005
Posts: 8
Hi Brent ,

I tried placing the name="maxlength", still its not working .....
Only "required " works....
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: maxlength validation not working
 
Similar Threads
Validation Problem #2
Validator Problem
How to practice struts in Eclipse
custom validator and custom tags
Exception while loading the validation.xml in strusts