struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Germuska <>
Subject Re: <html:file> tag
Date Thu, 03 Oct 2002 15:40:59 GMT
At 11:09 AM -0400 2002/10/03, Matt Sales wrote:
>I'm having trouble with the <html:file> tag...
>Here's a snippet of my jsp:
><html:form method="POST" action="/"
>     <html:file property="file"/>
>I've also tried the <html:file> tag using the accepts attribute,
>accepts="", and
>with, of course, the corresponding property in the actionForm set to the
>correct type.
>Every time the form is submitted, I get a Servlet Exception:
>BeanUtils.populate and ArgumentTypeMismatchException.
>Am I missing something here?  Should the type of the upload actionForm
>property be File? String?  something else?

something else: org.apache.struts.upload.FormFile

Struts uses a user-configurable implementation of type 
org.apache.struts.upload.MultipartRequestHandler as a factory which 
produces an implementation of FormFile from the HttpServletRequest. 
You rarely have to worry about this detail, but you can set an 
alternative MultipartRequestHandler in the <controller> section of 
your struts-config.xml file.

All you really care about is that when you get the ActionForm in your 
Action, it has a property of type FormFile.

Hope that helps.


* Joe Germuska    { }
"It's pitiful, sometimes, if they've got it bad. Their eyes get 
glazed, they go white, their hands tremble.... As I watch them I 
often feel that a dope peddler is a gentleman compared with the man 
who sells records."
	--Sam Goody, 1956

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

View raw message