Hi

I am validating form data in a Spring MVC app.

Here is the validation.xml and the input field tag (ignore the spring
bind stuff). The field I am trying to validate is the "fileContent"
field. If I change the field type to text as a test, it validates. So,
it seems that the commons validator only works on String type fields.

<spring:bind path="audioFile.fileContent">
        <input type="file" size="40" name="<c:out
value='${status.expression}'/>" class="input_text" 
                 value="<c:out value='${fileContent}'/>"/>
</spring:bind>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE form-validation PUBLIC "-//Apache Software Foundation//DTD
Commons Validator Rules Configuration 1.1//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>
<form-validation>
        <formset>
                <form name="audioFile">
                        <field property="fileContent"
depends="required">
                                <arg0 key="audioFile.fileContent"/>
                        </field>                        
                        <field property="description"
depends="required">
                                <arg0 key="audioFile.description"/>
                        </field>
                </form>
        </formset>
</form-validation>

Thanks
Graham Renney 


-----Original Message-----
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: Monday 20 March 2006 16:38
To: Jakarta Commons Users List
Subject: Re: [commons-validator]

On 3/20/06, Graham Renney <[EMAIL PROTECTED]> wrote:
> Hi
>
> Can commons validator NOT validate upload fields (<input
> type="file".../>) in a form on the server side? Seems to just skip the

> field even though it is correctly defined in the validation.xml

What environment are you using this in - Struts? Also please give more
details about what you're trying to validate - a "snip" of the
validation xml would be good.

Niall

> Thanks
> Graham Renney

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

This message and any attachments are confidential and intended solely for the 
addressee. If you have received this message in error, please notify Discovery 
immediately, telephone number +27 11 529 2888. Any unauthorised use; alteration 
or dissemination of the contents of this email is strictly prohibited. In no 
event will Discovery or the sender be liable in any manner whatsoever to any 
person for any loss or any direct, indirect, special or consequential damages 
arising from use of this email or any linked website, including, without 
limitation, from any lost profits, business interruption, loss of programmes or 
other data that may be stored on any information handling system or otherwise 
from any assurance that this email is virus free even if Discovery is expressly 
advised of the possibility of such damages. Discovery is an Authorised 
Financial Services Provider.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to