Yeah it's not possible on the client side. (security )

I'm not sure I like the generic error being thrown though, it seems like it
would be nicer to be able to validate the form instead but I know that the
IO streams might not make this possible. (Ie once it's open it's open and
the data is going to come....garr )

On 9/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Thanks for the info, Ben.

This is depressing, though.  This means that the entire file needs to be
uploaded to the server before you can validate it is less than the max
allowed size, right?

Ugh.

-----Original Message-----
From: Ben Dotte [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 21, 2006 4:25 PM
To: Tapestry users
Subject: RE: How do I intercept an
org.apache.hivemind.ApplicationRuntimeException?

This thread might be a little help:
http://article.gmane.org/gmane.comp.java.tapestry.user/29684

I've never found a way to override the "ugly" error page, I believe the
exception is thrown by commons fileupload, not Tapestry. So I just set
MultipartDecoderImpl's maxSize to "-1" and validate the filesize with a
validator.

HTH

Ben

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 21, 2006 12:52 PM
To: [email protected]
Subject: How do I intercept an
org.apache.hivemind.ApplicationRuntimeException?

I have a page that allows for file uploads, up to 10MB.

The limit is enforced in my hivemodule.xml with this snippet:

<!-- Maximum upload size of files is 10MB = 10*1024*1024 -->
<implementation service-id="tapestry.multipart.ServletMultipartDecoder">
  <create-instance
class="org.apache.tapestry.multipart.MultipartDecoderImpl,maxSize=104857
60" model="threaded" />
</implementation>

It works perfectly...if you upload a file larger than 10MB, you get a
big "ugly" error page (pasted below).  We catch all other exceptions
with a configuration line in the .application file:
<page name="Exception"
specification-path="/foo/bar/CustomException.page"/>

But that isn't getting triggered on these > 10MB upload errors.

Thoughts? And Thanks,
Tom


Here's the big ugly error page:
-------------------------------

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

org.apache.hivemind.ApplicationRuntimeException: Unable to decode
multipart encoded request: the request was rejected because its size
(23940489) exceeds the configured maximum (10485760)

org.apache.tapestry.multipart.MultipartDecoderImpl.decode(MultipartDecod
erImpl.java:56)

$ServletMultipartDecoder_10dd1546644.decode($ServletMultipartDecoder_10d
d1546644.java)

$ServletMultipartDecoder_10dd1546645.decode($ServletMultipartDecoder_10d
d1546645.java)
        org.apache.tapestry.multipart.MultipartD....etc ad naseum....

---------------------------------------------------------------------
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]


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




--
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

Reply via email to