You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Filip Polsakiewicz <Fi...@innoface.de> on 2003/08/04 14:24:42 UTC

using html:file and commons-fileupload

Hi,
i have the following problem. I use a <html:file> element to choose a file
and want it to be uploaded using commons-fileupload.
When i submit my form i get the following exception:

java.lang.NoSuchMethodError:
org.apache.commons.fileupload.FileUpload.setSizeMax(I)V

my code looks something like

<html:form action="/myactions/blabla" method="post"
enctype="multipart/form-data">
	<html:file property="myFile"/>
</html:form>

By the way: which datatype does the property have to be of?
My Action is not even called -> the exception comes before the excute-Method
is called

Help please.

Filip



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


RE: using html:file and commons-fileupload

Posted by Filip Polsakiewicz <Fi...@innoface.de>.
I use commons-fileupload-1.0.jar

here the html:code

        <html:form action="/core/contact/imageSelect" method="POST"
enctype="multipart/form-data">
            <html:file property="file"/>
            <html:submit>submit</html:submit>
        </html:form>

> -----Original Message-----
> From: Alen Ribic [mailto:alenr@mweb.co.za]
> Sent: Monday, August 04, 2003 3:09 PM
> To: Struts Users Mailing List
> Subject: Re: using html:file and commons-fileupload
>
>
> Of top of my head:
> Are you using a version of upload commons  that came with Struts or...?
>
> Also, you got some code <snippet/> for clues?
>
> --Alen
>
>
> ----- Original Message -----
> From: "Filip Polsakiewicz" <Fi...@innoface.de>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Monday, August 04, 2003 2:44 PM
> Subject: RE: using html:file and commons-fileupload
>
>
> > Hi,
> > changing the type to FormFile didn't solve the problem. Any other ideas?
> >
> >
> > > -----Original Message-----
> > > From: Alen Ribic [mailto:alenr@mweb.co.za]
> > > Sent: Monday, August 04, 2003 2:28 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: using html:file and commons-fileupload
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Filip Polsakiewicz" <Fi...@innoface.de>
> > > To: "Struts Users Mailinglist" <st...@jakarta.apache.org>
> > > Sent: Monday, August 04, 2003 2:24 PM
> > > Subject: using html:file and commons-fileupload
> > >
> > >
> > > > Hi,
> > > > i have the following problem. I use a <html:file> element to
> > > choose a file
> > > > and want it to be uploaded using commons-fileupload.
> > > > When i submit my form i get the following exception:
> > > >
> > > > java.lang.NoSuchMethodError:
> > > > org.apache.commons.fileupload.FileUpload.setSizeMax(I)V
> > > >
> > > > my code looks something like
> > > >
> > > > <html:form action="/myactions/blabla" method="post"
> > > > enctype="multipart/form-data">
> > > > <html:file property="myFile"/>
> > > > </html:form>
> > > >
> > >
> > > > By the way: which datatype does the property have to be of?
> > >
> > > As far as I can remember it should be of type:
> > > org.apache.struts.upload.FormFile.
> > >
> > > > My Action is not even called -> the exception comes before the
> > > excute-Method
> > > > is called
> > > >
> > > > Help please.
> > > >
> > > > Filip
> > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Re: using html:file and commons-fileupload

Posted by Alen Ribic <al...@mweb.co.za>.
Of top of my head:
Are you using a version of upload commons  that came with Struts or...? 

Also, you got some code <snippet/> for clues?

--Alen


----- Original Message ----- 
From: "Filip Polsakiewicz" <Fi...@innoface.de>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, August 04, 2003 2:44 PM
Subject: RE: using html:file and commons-fileupload


> Hi,
> changing the type to FormFile didn't solve the problem. Any other ideas?
> 
> 
> > -----Original Message-----
> > From: Alen Ribic [mailto:alenr@mweb.co.za]
> > Sent: Monday, August 04, 2003 2:28 PM
> > To: Struts Users Mailing List
> > Subject: Re: using html:file and commons-fileupload
> > 
> > 
> > 
> > ----- Original Message -----
> > From: "Filip Polsakiewicz" <Fi...@innoface.de>
> > To: "Struts Users Mailinglist" <st...@jakarta.apache.org>
> > Sent: Monday, August 04, 2003 2:24 PM
> > Subject: using html:file and commons-fileupload
> > 
> > 
> > > Hi,
> > > i have the following problem. I use a <html:file> element to 
> > choose a file
> > > and want it to be uploaded using commons-fileupload.
> > > When i submit my form i get the following exception:
> > >
> > > java.lang.NoSuchMethodError:
> > > org.apache.commons.fileupload.FileUpload.setSizeMax(I)V
> > >
> > > my code looks something like
> > >
> > > <html:form action="/myactions/blabla" method="post"
> > > enctype="multipart/form-data">
> > > <html:file property="myFile"/>
> > > </html:form>
> > >
> > 
> > > By the way: which datatype does the property have to be of?
> > 
> > As far as I can remember it should be of type:
> > org.apache.struts.upload.FormFile.
> > 
> > > My Action is not even called -> the exception comes before the
> > excute-Method
> > > is called
> > >
> > > Help please.
> > >
> > > Filip
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


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


RE: using html:file and commons-fileupload

Posted by Filip Polsakiewicz <Fi...@innoface.de>.
Hi,
changing the type to FormFile didn't solve the problem. Any other ideas?


> -----Original Message-----
> From: Alen Ribic [mailto:alenr@mweb.co.za]
> Sent: Monday, August 04, 2003 2:28 PM
> To: Struts Users Mailing List
> Subject: Re: using html:file and commons-fileupload
> 
> 
> 
> ----- Original Message -----
> From: "Filip Polsakiewicz" <Fi...@innoface.de>
> To: "Struts Users Mailinglist" <st...@jakarta.apache.org>
> Sent: Monday, August 04, 2003 2:24 PM
> Subject: using html:file and commons-fileupload
> 
> 
> > Hi,
> > i have the following problem. I use a <html:file> element to 
> choose a file
> > and want it to be uploaded using commons-fileupload.
> > When i submit my form i get the following exception:
> >
> > java.lang.NoSuchMethodError:
> > org.apache.commons.fileupload.FileUpload.setSizeMax(I)V
> >
> > my code looks something like
> >
> > <html:form action="/myactions/blabla" method="post"
> > enctype="multipart/form-data">
> > <html:file property="myFile"/>
> > </html:form>
> >
> 
> > By the way: which datatype does the property have to be of?
> 
> As far as I can remember it should be of type:
> org.apache.struts.upload.FormFile.
> 
> > My Action is not even called -> the exception comes before the
> excute-Method
> > is called
> >
> > Help please.
> >
> > Filip
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

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


Re: using html:file and commons-fileupload

Posted by Alen Ribic <al...@mweb.co.za>.
----- Original Message -----
From: "Filip Polsakiewicz" <Fi...@innoface.de>
To: "Struts Users Mailinglist" <st...@jakarta.apache.org>
Sent: Monday, August 04, 2003 2:24 PM
Subject: using html:file and commons-fileupload


> Hi,
> i have the following problem. I use a <html:file> element to choose a file
> and want it to be uploaded using commons-fileupload.
> When i submit my form i get the following exception:
>
> java.lang.NoSuchMethodError:
> org.apache.commons.fileupload.FileUpload.setSizeMax(I)V
>
> my code looks something like
>
> <html:form action="/myactions/blabla" method="post"
> enctype="multipart/form-data">
> <html:file property="myFile"/>
> </html:form>
>

> By the way: which datatype does the property have to be of?

As far as I can remember it should be of type:
org.apache.struts.upload.FormFile.

> My Action is not even called -> the exception comes before the
excute-Method
> is called
>
> Help please.
>
> Filip
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


StrutsTestCase problem with setRequestPathInfo()

Posted by Daniel Massie <da...@jario.com>.
I am trying to use the StrutsTestCase extension of Junit but keep getting
the following error when I try to use it, the error occurs when
actionPerform() is called. Any help would be greatly appreciated.

[main] DEBUG servletunit.struts.MockStrutsTestCase  - Entering setUp() 80
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Exiting setUp() 90
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Entering
setConfigFile() : pathName = /WEB-INF/struts-config.xml 90   [main] DEBUG
servletunit.struts.MockStrutsTestCase  - Entering setConfigFile() :
moduleName = null, pathname =/WEB-INF/struts-config.xml 90
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Exiting
setConfigFile() 90
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Exiting
setConfigFile() 90
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Entering
setRequestPathInfo() : pathInfo = /login.do 90
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Entering
setRequestPathInfo() : moduleName = , pathInfo = /login.do 100  [main] DEBUG
servletunit.struts.Common  - Entering stripActionPath() : path = /login.do
100
[main] DEBUG servletunit.struts.Common  - Exiting stripActionPath() -
returning path = /login 100
[main] DEBUG servletunit.struts.MockStrutsTestCase  - setRequestPathInfo() :
setting request attribute - name = not.used.at.all, value =  100
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Exiting
setRequestPathInfo() 100
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Exiting
setRequestPathInfo() 100
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Entering
addRequestParameter() : parameterName = userName, parameterValue = admin 100
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Exiting
addRequestParameter() 100
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Entering
addRequestParameter() : parameterName = password, parameterValue = password
110
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Exiting
addRequestParameter() 110
[main] DEBUG servletunit.struts.MockStrutsTestCase  - Entering
actionPerform() 110  [main] DEBUG servletunit.struts.MockStrutsTestCase  -
Entering getActionServlet() 110
[main] DEBUG servletunit.struts.MockStrutsTestCase  - getActionServlet() :
intializing actionServlet 380
[main] ERROR org.apache.commons.digester.Digester  - Parse Fatal Error at
line 0 column 0: File "" not found. org.xml.sax.SAXParseException: File ""
not found.


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


RE: using html:file and commons-fileupload

Posted by Alex Shneyderman <al...@law.columbia.edu>.
The property will have to be of org.apache.struts.upload.FormFile
Type; that is probably the source of your problem

Alex.

> -----Original Message-----
> From: Filip Polsakiewicz [mailto:Filip.Polsakiewicz@innoface.de]
> Sent: Monday, August 04, 2003 8:25 AM
> To: Struts Users Mailinglist
> Subject: using html:file and commons-fileupload
> 
> Hi,
> i have the following problem. I use a <html:file> element to choose a
file
> and want it to be uploaded using commons-fileupload.
> When i submit my form i get the following exception:
> 
> java.lang.NoSuchMethodError:
> org.apache.commons.fileupload.FileUpload.setSizeMax(I)V
> 
> my code looks something like
> 
> <html:form action="/myactions/blabla" method="post"
> enctype="multipart/form-data">
> 	<html:file property="myFile"/>
> </html:form>
> 
> By the way: which datatype does the property have to be of?
> My Action is not even called -> the exception comes before the excute-
> Method
> is called
> 
> Help please.
> 
> Filip
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org



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