struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richmond Te <richmon...@yahoo.com>
Subject RE: <html:file> Problems
Date Thu, 12 Dec 2002 06:52:10 GMT
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" <GMouratidis@heiler.com>
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:richmondte@yahoo.com]
> 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" <GMouratidis@heiler.com>
> 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:gemes@regens.hu]
> > 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:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> >
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> http://mailplus.yahoo.com
> 
> --
> To unsubscribe, e-mail:  
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message