Hi Thiago,

I have code before, that was used to intercept file upload exceptions, can
we use similar approach to intercept this exception too?

public class UploadRequestFilter implements HttpServletRequestFilter {
    final private Logger logger;

    public UploadRequestFilter(Logger logger) {
        this.logger = logger;
    }

    public boolean service(HttpServletRequest request, HttpServletResponse
response,
                           HttpServletRequestHandler handler) throws
IOException {

        boolean result = true;
        try {
            result = handler.service(request, response);
        } catch (RuntimeException e) {
            Throwable err = e.getCause();
            logger.info(err.getMessage());
            if (err instanceof
FileUploadBase.FileSizeLimitExceededException) {
                    response.sendRedirect("/info/filesizeproblem");
            } else if (err instanceof FileUploadBase.IOFileUploadException)
{
                logger.error("looks like time out error");
                try {
                    throw err;
                } catch (Throwable throwable) {
                    throwable.printStackTrace();
                }
            } else {
            }
        }
        return result;
    }
}



Thiago H. de Paula Figueiredo wrote:
> 
> On Tue, Mar 17, 2009 at 9:40 AM, Angelo Chen <angelochen...@yahoo.com.hk>
> wrote:
> 
>> Hi Thiago,
> 
> Hi!
> 
>> My problem is, those links are already distributed, can't be changed, if
>> I
>> can intercept this exception then I can redirect the process, any idea
>> how I
>> can intercept that exception?
> 
> One solution is to override the
> org.apache.tapestry5.services.URLEncoder service.
> To intercept exceptions, you'll need to override the
> RequestExceptionHandler service.
> 
> -- 
> Thiago
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/t5%3A-intercepting-exceptions-from-RequestExceptionHandler-tp22556866p22559028.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to