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: users@tapestry.apache.org
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]

Reply via email to