Thanks for the tip, it worked to get me by the errors I was having.

I'm now stuck with not getting the actual file uploaded.  I put logging in the 
getters and setters in my java class, though the filename field is fetched 
correctly, the actually file is not: there's a temp file that gets created in 
my C:\jboss-4.2.1.GA\server\default\work\jboss.web\localhost\zen.server 
directory (which is the pathname returned by the file object), but it only has 
the word import in it (not the content of the file that was uploaded).

has anyone come across this problem before?  how do I gain access to the 
uploaded file?


> Make sure you have commons-io, commons-fileupload, and commons-collections
> jar files in your WEB-INF/lib directory.  At least this worked for me.
> 
> Thanks,
> 
> 
> On Wed, 2007-09-12 at 19:07 -0400, Session A Mwamufiya wrote:
>> Hi,
>> 
>> I'm using struts 2.0.6, and I keep getting the following exception when
>> I try to replicate the fileupload example in the showcase:
>> 
>> Unable to load bean
>> org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) -
>> [unknown location] 
>> org.apache.struts2.config.BeanSelectionProvider$ObjectFactoryDelegateFa
>> ctory.create(BeanSelectionProvider.java:247) 
>> com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuild
>> er.java:134) 
>> com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.
>> java:476) 
>> com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.
>> java:486) 
>> com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:
>> 517) 
>> com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImp
>> l.java:542) 
>> com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.
>> java:515) 
>> org.apache.struts2.dispatcher.Dispatcher.wrapRequest(Dispatcher.java:70
>> 0) 
>> org.apache.struts2.dispatcher.FilterDispatcher.prepareDispatcherAndWrap
>> Request(FilterDispatcher.java:327) 
>> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatche
>> r.java:390) 
>> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilt
>> er.java:96)
>> 
>> Here is my jsp: <s:form action="SMIGImport" method="POST"
>> enctype="multipart/form-data"> <s:file name="upload" label="File" /> 
>> <s:submit key="importSMIGButton" method="importSMIGButtonPressed" /> 
>> </s:form>
>> 
>> Here is my validation.xml: <validators> <field name="upload"> 
>> <field-validator type="fieldexpression"> <param
>> name="expression"><![CDATA[upload.length() > 0]]></param> <message>File
>> cannot be empty</message> </field-validator> </field> </validators>
>> 
>> If I remove enctype="multipart/form-data", I get the following error:
>> Invalid field value for field "upload".
>> 
>> Any idea how to fix this?  Does this have to do with my version of
>> struts, or is there something that I'm missing.
>> 
>> Thanks, Session
>> 
>> 
>> --------------------------------------------------------------------- To
>> unsubscribe, e-mail: [EMAIL PROTECTED] For additional
>> commands, e-mail: [EMAIL PROTECTED]
>> 
> -- Randall Svancara System Administrator Horticulture and Landscape
> Architecture 509-335-7093
> 
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: [EMAIL PROTECTED] For additional
> commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to