You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Michał 'Gandalf' Stawicki <st...@gmail.com> on 2007/03/17 17:24:48 UTC

[Tobago] TobagoMultipartFormdataFilter & max size

Hello,

When I try to upload too large file, I simply get an exception. Am I
missing something? I would like to stay on the same page / get some
validation error. On my JSP I have:

<tc:file
value="#{clientManagedBean.newOrderControler.attachmentsController.fileItem}"
tip="Wprowadź nazwe pliku"
id="fileAddBrowse">

<tc:validateFileItem maxSize="10485760" />

</tc:file>

regards,
michael

-- 
stawicki@gmail.com
http://stawicki.jasliska.pl
GG: 3691111
JID: stawicki@gmail.com

Re: [Tobago] TobagoMultipartFormdataFilter & max size

Posted by Michał 'Gandalf' Stawicki <st...@gmail.com>.
No, and from your qustion I presume it should be?
I thought that the file control would justf turn red, as with other controls.

regards,
michael

On 17/03/07, Bernd Bohmann <be...@atanion.com> wrote:
> Hello Michael,
>
> is a tc:messages tag on your page or popup?
>
> Regards
>
> Bernd
>
> Michał 'Gandalf' Stawicki wrote:
> > Hello Bernd,
> >
> > I was using filter, now I have switched to tobago-fileupload.jar as
> > you suggested.
> >
> > Now in my logs I'm getting:
> >
> > javax.faces.FacesException:
> > org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
> > the request was rejected because its size (258792409) exceeds the
> > configured maximum (69206016)
> >
> > if I try to upload too large file.
> >
> > So, I guess there is no nice way to simply get validation error if the
> > file size exceeds the one set in web.xml, am I right? I can just set
> > some large hard limit and set desired limit on tc:validateFileItem? Or
> > am I missing something? I can't use <error-page> for the exception, as
> > I have to stay with the form in which I have tc:file tag.
> >
> > Thanks for help,
> > michael
> >
> > On 17/03/07, Bernd Bohmann <be...@atanion.com> wrote:
> >> Hello Michael,
> >>
> >> how do you configure fileupload in tobago?
> >> I assume the Filter.
> >>
> >> The prefered option is tobago-fileupload.jar. This jar generates the
> >> error messages inside the faces lifecycle.
> >> The filter throws an exception outside the faces lifecycle.
> >> Both filter or jar have a hard limit (See configuration options in faq).
> >>
> >> With the validator you can configure some other validation after the
> >> file is downloaded.
> >>
> >> Regards
> >>
> >> Bernd
> >>
> >> Michał 'Gandalf' Stawicki wrote:
> >> > Hello,
> >> >
> >> > When I try to upload too large file, I simply get an exception. Am I
> >> > missing something? I would like to stay on the same page / get some
> >> > validation error. On my JSP I have:
> >> >
> >> > <tc:file
> >> >
> >> value="#{clientManagedBean.newOrderControler.attachmentsController.fileItem}"
> >>
> >> >
> >> > tip="Wprowadź nazwe pliku"
> >> > id="fileAddBrowse">
> >> >
> >> > <tc:validateFileItem maxSize="10485760" />
> >> >
> >> > </tc:file>
> >> >
> >> > regards,
> >> > michael
> >> >
> >>
> >
> >
>


-- 
stawicki@gmail.com
http://stawicki.jasliska.pl
GG: 3691111
JID: stawicki@gmail.com

Re: [Tobago] TobagoMultipartFormdataFilter & max size

Posted by Michał 'Gandalf' Stawicki <st...@gmail.com>.
Hi Volker,

now it works ok. The only drawback is that user has to wait for the
file to upload to get error message telling him that it was too big,
but I guess there's no helping it.

Thanks for help,
michael

On 17/03/07, Volker Weber <v....@inexso.de> wrote:
> Hi Michał,
>
> try setting the limit to -1, this may help.
>
> tobago uses commons-fileupload and the max size is the maximum allowed
> size of the request. if a request exeeds this threshold the complete
> processing is interupted by this library. -1 sets this to unlimited.
>
> Regards,
>   Volker
>
> 2007/3/17, Michał 'Gandalf' Stawicki <st...@gmail.com>:
> > I have added tc:messages, I have set the hard limit to 10m, inside
> > tc:file tag I have <tc:validateFileItem maxSize="5242880" /> (5MB) but
> > I am still getting exception:
> >
> > 2007-03-17 19:53:01
> > org.apache.myfaces.tobago.fileupload.FileUploadFacesContextFactoryImpl
> > getFacesContext
> > SEVERE:
> > javax.faces.FacesException:
> > org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
> > the request was rejected because its size (258792412) exceeds the
> > configured maximum (10485760)
> >
> > Just can't get it to work ;/
> >
> > regards
> > michael
> >
> > On 17/03/07, Bernd Bohmann <be...@atanion.com> wrote:
> > > Hello Michael,
> > >
> > > is a tc:messages tag on your page or popup?
> > >
> > > Regards
> > >
> > > Bernd
> > >
> > > Michał 'Gandalf' Stawicki wrote:
> > > > Hello Bernd,
> > > >
> > > > I was using filter, now I have switched to tobago-fileupload.jar as
> > > > you suggested.
> > > >
> > > > Now in my logs I'm getting:
> > > >
> > > > javax.faces.FacesException:
> > > > org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
> > > > the request was rejected because its size (258792409) exceeds the
> > > > configured maximum (69206016)
> > > >
> > > > if I try to upload too large file.
> > > >
> > > > So, I guess there is no nice way to simply get validation error if the
> > > > file size exceeds the one set in web.xml, am I right? I can just set
> > > > some large hard limit and set desired limit on tc:validateFileItem? Or
> > > > am I missing something? I can't use <error-page> for the exception, as
> > > > I have to stay with the form in which I have tc:file tag.
> > > >
> > > > Thanks for help,
> > > > michael
> > > >
> > > > On 17/03/07, Bernd Bohmann <be...@atanion.com> wrote:
> > > >> Hello Michael,
> > > >>
> > > >> how do you configure fileupload in tobago?
> > > >> I assume the Filter.
> > > >>
> > > >> The prefered option is tobago-fileupload.jar. This jar generates the
> > > >> error messages inside the faces lifecycle.
> > > >> The filter throws an exception outside the faces lifecycle.
> > > >> Both filter or jar have a hard limit (See configuration options in faq).
> > > >>
> > > >> With the validator you can configure some other validation after the
> > > >> file is downloaded.
> > > >>
> > > >> Regards
> > > >>
> > > >> Bernd
> > > >>
> > > >> Michał 'Gandalf' Stawicki wrote:
> > > >> > Hello,
> > > >> >
> > > >> > When I try to upload too large file, I simply get an exception. Am I
> > > >> > missing something? I would like to stay on the same page / get some
> > > >> > validation error. On my JSP I have:
> > > >> >
> > > >> > <tc:file
> > > >> >
> > > >> value="#{clientManagedBean.newOrderControler.attachmentsController.fileItem}"
> > > >>
> > > >> >
> > > >> > tip="Wprowadź nazwe pliku"
> > > >> > id="fileAddBrowse">
> > > >> >
> > > >> > <tc:validateFileItem maxSize="10485760" />
> > > >> >
> > > >> > </tc:file>
> > > >> >
> > > >> > regards,
> > > >> > michael
> > > >> >
> > > >>
> > > >
> > > >
> > >
> >
> >
> > --
> > stawicki@gmail.com
> > http://stawicki.jasliska.pl
> > GG: 3691111
> > JID: stawicki@gmail.com
> >
>


-- 
stawicki@gmail.com
http://stawicki.jasliska.pl
GG: 3691111
JID: stawicki@gmail.com

Re: [Tobago] TobagoMultipartFormdataFilter & max size

Posted by Volker Weber <v....@inexso.de>.
Hi Michał,

try setting the limit to -1, this may help.

tobago uses commons-fileupload and the max size is the maximum allowed
size of the request. if a request exeeds this threshold the complete
processing is interupted by this library. -1 sets this to unlimited.

Regards,
  Volker

2007/3/17, Michał 'Gandalf' Stawicki <st...@gmail.com>:
> I have added tc:messages, I have set the hard limit to 10m, inside
> tc:file tag I have <tc:validateFileItem maxSize="5242880" /> (5MB) but
> I am still getting exception:
>
> 2007-03-17 19:53:01
> org.apache.myfaces.tobago.fileupload.FileUploadFacesContextFactoryImpl
> getFacesContext
> SEVERE:
> javax.faces.FacesException:
> org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
> the request was rejected because its size (258792412) exceeds the
> configured maximum (10485760)
>
> Just can't get it to work ;/
>
> regards
> michael
>
> On 17/03/07, Bernd Bohmann <be...@atanion.com> wrote:
> > Hello Michael,
> >
> > is a tc:messages tag on your page or popup?
> >
> > Regards
> >
> > Bernd
> >
> > Michał 'Gandalf' Stawicki wrote:
> > > Hello Bernd,
> > >
> > > I was using filter, now I have switched to tobago-fileupload.jar as
> > > you suggested.
> > >
> > > Now in my logs I'm getting:
> > >
> > > javax.faces.FacesException:
> > > org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
> > > the request was rejected because its size (258792409) exceeds the
> > > configured maximum (69206016)
> > >
> > > if I try to upload too large file.
> > >
> > > So, I guess there is no nice way to simply get validation error if the
> > > file size exceeds the one set in web.xml, am I right? I can just set
> > > some large hard limit and set desired limit on tc:validateFileItem? Or
> > > am I missing something? I can't use <error-page> for the exception, as
> > > I have to stay with the form in which I have tc:file tag.
> > >
> > > Thanks for help,
> > > michael
> > >
> > > On 17/03/07, Bernd Bohmann <be...@atanion.com> wrote:
> > >> Hello Michael,
> > >>
> > >> how do you configure fileupload in tobago?
> > >> I assume the Filter.
> > >>
> > >> The prefered option is tobago-fileupload.jar. This jar generates the
> > >> error messages inside the faces lifecycle.
> > >> The filter throws an exception outside the faces lifecycle.
> > >> Both filter or jar have a hard limit (See configuration options in faq).
> > >>
> > >> With the validator you can configure some other validation after the
> > >> file is downloaded.
> > >>
> > >> Regards
> > >>
> > >> Bernd
> > >>
> > >> Michał 'Gandalf' Stawicki wrote:
> > >> > Hello,
> > >> >
> > >> > When I try to upload too large file, I simply get an exception. Am I
> > >> > missing something? I would like to stay on the same page / get some
> > >> > validation error. On my JSP I have:
> > >> >
> > >> > <tc:file
> > >> >
> > >> value="#{clientManagedBean.newOrderControler.attachmentsController.fileItem}"
> > >>
> > >> >
> > >> > tip="Wprowadź nazwe pliku"
> > >> > id="fileAddBrowse">
> > >> >
> > >> > <tc:validateFileItem maxSize="10485760" />
> > >> >
> > >> > </tc:file>
> > >> >
> > >> > regards,
> > >> > michael
> > >> >
> > >>
> > >
> > >
> >
>
>
> --
> stawicki@gmail.com
> http://stawicki.jasliska.pl
> GG: 3691111
> JID: stawicki@gmail.com
>

Re: [Tobago] TobagoMultipartFormdataFilter & max size

Posted by Michał 'Gandalf' Stawicki <st...@gmail.com>.
I have added tc:messages, I have set the hard limit to 10m, inside
tc:file tag I have <tc:validateFileItem maxSize="5242880" /> (5MB) but
I am still getting exception:

2007-03-17 19:53:01
org.apache.myfaces.tobago.fileupload.FileUploadFacesContextFactoryImpl
getFacesContext
SEVERE:
javax.faces.FacesException:
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
the request was rejected because its size (258792412) exceeds the
configured maximum (10485760)

Just can't get it to work ;/

regards
michael

On 17/03/07, Bernd Bohmann <be...@atanion.com> wrote:
> Hello Michael,
>
> is a tc:messages tag on your page or popup?
>
> Regards
>
> Bernd
>
> Michał 'Gandalf' Stawicki wrote:
> > Hello Bernd,
> >
> > I was using filter, now I have switched to tobago-fileupload.jar as
> > you suggested.
> >
> > Now in my logs I'm getting:
> >
> > javax.faces.FacesException:
> > org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
> > the request was rejected because its size (258792409) exceeds the
> > configured maximum (69206016)
> >
> > if I try to upload too large file.
> >
> > So, I guess there is no nice way to simply get validation error if the
> > file size exceeds the one set in web.xml, am I right? I can just set
> > some large hard limit and set desired limit on tc:validateFileItem? Or
> > am I missing something? I can't use <error-page> for the exception, as
> > I have to stay with the form in which I have tc:file tag.
> >
> > Thanks for help,
> > michael
> >
> > On 17/03/07, Bernd Bohmann <be...@atanion.com> wrote:
> >> Hello Michael,
> >>
> >> how do you configure fileupload in tobago?
> >> I assume the Filter.
> >>
> >> The prefered option is tobago-fileupload.jar. This jar generates the
> >> error messages inside the faces lifecycle.
> >> The filter throws an exception outside the faces lifecycle.
> >> Both filter or jar have a hard limit (See configuration options in faq).
> >>
> >> With the validator you can configure some other validation after the
> >> file is downloaded.
> >>
> >> Regards
> >>
> >> Bernd
> >>
> >> Michał 'Gandalf' Stawicki wrote:
> >> > Hello,
> >> >
> >> > When I try to upload too large file, I simply get an exception. Am I
> >> > missing something? I would like to stay on the same page / get some
> >> > validation error. On my JSP I have:
> >> >
> >> > <tc:file
> >> >
> >> value="#{clientManagedBean.newOrderControler.attachmentsController.fileItem}"
> >>
> >> >
> >> > tip="Wprowadź nazwe pliku"
> >> > id="fileAddBrowse">
> >> >
> >> > <tc:validateFileItem maxSize="10485760" />
> >> >
> >> > </tc:file>
> >> >
> >> > regards,
> >> > michael
> >> >
> >>
> >
> >
>


-- 
stawicki@gmail.com
http://stawicki.jasliska.pl
GG: 3691111
JID: stawicki@gmail.com

Re: [Tobago] TobagoMultipartFormdataFilter & max size

Posted by Bernd Bohmann <be...@atanion.com>.
Hello Michael,

is a tc:messages tag on your page or popup?

Regards

Bernd

Michał 'Gandalf' Stawicki wrote:
> Hello Bernd,
> 
> I was using filter, now I have switched to tobago-fileupload.jar as
> you suggested.
> 
> Now in my logs I'm getting:
> 
> javax.faces.FacesException:
> org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
> the request was rejected because its size (258792409) exceeds the
> configured maximum (69206016)
> 
> if I try to upload too large file.
> 
> So, I guess there is no nice way to simply get validation error if the
> file size exceeds the one set in web.xml, am I right? I can just set
> some large hard limit and set desired limit on tc:validateFileItem? Or
> am I missing something? I can't use <error-page> for the exception, as
> I have to stay with the form in which I have tc:file tag.
> 
> Thanks for help,
> michael
> 
> On 17/03/07, Bernd Bohmann <be...@atanion.com> wrote:
>> Hello Michael,
>>
>> how do you configure fileupload in tobago?
>> I assume the Filter.
>>
>> The prefered option is tobago-fileupload.jar. This jar generates the
>> error messages inside the faces lifecycle.
>> The filter throws an exception outside the faces lifecycle.
>> Both filter or jar have a hard limit (See configuration options in faq).
>>
>> With the validator you can configure some other validation after the
>> file is downloaded.
>>
>> Regards
>>
>> Bernd
>>
>> Michał 'Gandalf' Stawicki wrote:
>> > Hello,
>> >
>> > When I try to upload too large file, I simply get an exception. Am I
>> > missing something? I would like to stay on the same page / get some
>> > validation error. On my JSP I have:
>> >
>> > <tc:file
>> > 
>> value="#{clientManagedBean.newOrderControler.attachmentsController.fileItem}" 
>>
>> >
>> > tip="Wprowadź nazwe pliku"
>> > id="fileAddBrowse">
>> >
>> > <tc:validateFileItem maxSize="10485760" />
>> >
>> > </tc:file>
>> >
>> > regards,
>> > michael
>> >
>>
> 
> 

Re: [Tobago] TobagoMultipartFormdataFilter & max size

Posted by Michał 'Gandalf' Stawicki <st...@gmail.com>.
Hello Bernd,

I was using filter, now I have switched to tobago-fileupload.jar as
you suggested.

Now in my logs I'm getting:

javax.faces.FacesException:
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
the request was rejected because its size (258792409) exceeds the
configured maximum (69206016)

if I try to upload too large file.

So, I guess there is no nice way to simply get validation error if the
file size exceeds the one set in web.xml, am I right? I can just set
some large hard limit and set desired limit on tc:validateFileItem? Or
am I missing something? I can't use <error-page> for the exception, as
I have to stay with the form in which I have tc:file tag.

Thanks for help,
michael

On 17/03/07, Bernd Bohmann <be...@atanion.com> wrote:
> Hello Michael,
>
> how do you configure fileupload in tobago?
> I assume the Filter.
>
> The prefered option is tobago-fileupload.jar. This jar generates the
> error messages inside the faces lifecycle.
> The filter throws an exception outside the faces lifecycle.
> Both filter or jar have a hard limit (See configuration options in faq).
>
> With the validator you can configure some other validation after the
> file is downloaded.
>
> Regards
>
> Bernd
>
> Michał 'Gandalf' Stawicki wrote:
> > Hello,
> >
> > When I try to upload too large file, I simply get an exception. Am I
> > missing something? I would like to stay on the same page / get some
> > validation error. On my JSP I have:
> >
> > <tc:file
> > value="#{clientManagedBean.newOrderControler.attachmentsController.fileItem}"
> >
> > tip="Wprowadź nazwe pliku"
> > id="fileAddBrowse">
> >
> > <tc:validateFileItem maxSize="10485760" />
> >
> > </tc:file>
> >
> > regards,
> > michael
> >
>


-- 
stawicki@gmail.com
http://stawicki.jasliska.pl
GG: 3691111
JID: stawicki@gmail.com

Re: [Tobago] TobagoMultipartFormdataFilter & max size

Posted by Bernd Bohmann <be...@atanion.com>.
Hello Michael,

how do you configure fileupload in tobago?
I assume the Filter.

The prefered option is tobago-fileupload.jar. This jar generates the 
error messages inside the faces lifecycle.
The filter throws an exception outside the faces lifecycle.
Both filter or jar have a hard limit (See configuration options in faq).

With the validator you can configure some other validation after the 
file is downloaded.

Regards

Bernd

Michał 'Gandalf' Stawicki wrote:
> Hello,
> 
> When I try to upload too large file, I simply get an exception. Am I
> missing something? I would like to stay on the same page / get some
> validation error. On my JSP I have:
> 
> <tc:file
> value="#{clientManagedBean.newOrderControler.attachmentsController.fileItem}" 
> 
> tip="Wprowadź nazwe pliku"
> id="fileAddBrowse">
> 
> <tc:validateFileItem maxSize="10485760" />
> 
> </tc:file>
> 
> regards,
> michael
>