commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graham Renney" <>
Subject RE: [commons-validator]
Date Wed, 22 Mar 2006 07:42:21 GMT

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}'/>"/>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE form-validation PUBLIC "-//Apache Software Foundation//DTD
Commons Validator Rules Configuration 1.1//EN"
		<form name="audioFile">
			<field property="fileContent"
				<arg0 key="audioFile.fileContent"/>
			<field property="description"
				<arg0 key="audioFile.description"/>

Graham Renney 

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

On 3/20/06, Graham Renney <> 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.


> Thanks
> Graham Renney

To unsubscribe, e-mail:
For additional commands, e-mail:

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:
For additional commands, e-mail:

View raw message