commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fleetwood, Brett \(DCS\)" <>
Subject using struts validator for a form-property of type="org.apache.struts.upload.FormFile"
Date Wed, 24 Jan 2007 07:16:41 GMT
G'day All,
I'm trying to validate a form that contains a
org.apache.struts.upload.FormFile as a form property on a JSP. From the
struts HTML tag-lib I'm using <html:file> in my JSP like this;
<html:file size="80" property="fileUpload" styleClass="inputfield"
errorStyleClass="inputfielderror" />

and I've set up the form bean like this;

<form-bean name="documentUploadForm" dynamic="true"

    <form-property name="fileUpload"

    <form-property name="documentIndex" type="java.lang.String" />

    <form-property name="personIndex" type="java.lang.String" />

    <form-property name="documentType" type="java.lang.String" />

    <form-property name="documentAttributeDescription"
type="java.lang.String" /> 


where the DcsDynaValidatorForm extends the DynaValidatorForm.

I'm trying to validate the form by checking the text of the FormFile
object to see if its blank. This is what i've tried in validation.xml
but it doesn't get picked up;

<field property="fileUpload" depends="required" >

    <arg key="File" resource="false" position="0" />


I'm quite new to this and if i've omitted anything then please let me

Thanks in advance,




  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message