i fixed this problem by extending the validator plugin and the code is a bit similar to the one you have below..
cheers --- "Mouratidis, Georg" <[EMAIL PROTECTED]> wrote: > Hi, > > i dont' use the validator plugin. i dont know how to > do. > i have set the validate attribute in > struts-config.xml to true. > in the validate method inside my form i check the > value and the length of the > input element. if there is an error i create an > ActionError. > > public ActionErrors validate(ActionMapping > mapping, > HttpServletRequest > request) { > > ActionErrors errors = new ActionErrors(); > > if ((uploadFile == null) || > (uploadFile.getFileName() == null) || > uploadFile.getFileName().length() == 0) > errors.add("uploadFile", new > ActionError("catalogimport.error.uploadfile.required")); > > // System.out.println("name=" + > uploadFile.getFileName()); > > return errors; > > } > > > -----Original Message----- > From: Richmond Te [mailto:[EMAIL PROTECTED]] > Sent: Dienstag, 10. Dezember 2002 04:45 > To: Struts Users Mailing List > Subject: RE: <html:file> Problems > > > what happens when you click on submit and there is > no > file? i am having trouble with validating this via > the > struts validator plugin.. > > --- "Mouratidis, Georg" <[EMAIL PROTECTED]> > wrote: > > No i have String. > > > > i changed it into FormFile and it works. > > i also inserted "import > > org.apache.struts.upload.FormFile;" > > > > thank you > > > > > > -----Original Message----- > > From: Gemes Tibor [mailto:[EMAIL PROTECTED]] > > Sent: Montag, 9. Dezember 2002 13:10 > > To: Struts Users Mailing List > > Subject: Re: <html:file> Problems > > > > > > 2002. december 9. 12:51 dátummal Mouratidis, Georg > > ezt írtad: > > > Greetings, > > > > > > i have a <html:file> tag. When i cklick to > submit > > the form the following > > > error appears: > > > > What do you have in the ActionForm? Is the > > corresponding property's type > > FormFile? > > > > Hth, > > > > Tib > > > > -- > > To unsubscribe, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > > -- > > To unsubscribe, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up > now. > http://mailplus.yahoo.com > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>