You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by andyhot <an...@di.uoa.gr> on 2006/08/29 22:29:15 UTC

Re: catch custom exception generated in tapestry app in filter?

Why not create your own exception page?

You can define a method
public void setException(Throwable value) { ... }
and Tapestry will call this before activating your exception page.




Phillip Rhodes wrote:
> I have a checked exception that is thrown from various listeners in my
> tapestry app.  I was hoping that I could use a servlet filter to catch
> these specific exceptions in order to deal with them.
>
> Is this just something that is impossible to do within the tapestry
> framework due to tapestry having to catch all exceptions for it's error
> reporting/interfacing with the servlet spec...
>
>
> thanks.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   


-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 


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


Re: catch custom exception generated in tapestry app in filter?

Posted by andyhot <an...@di.uoa.gr>.
Hmmm... I thought exceptions on Exception page were thrown unchanged,
but that's not true... they're also wrapped in an
ApplicationRuntimeException.

So, if you want some of your exceptions to be thrown out of the Tap servlet
and caught by a filter, you'd have to use a custom
org.apache.tapestry.error.ExceptionPresenter

See org.apache.tapestry.error.ExceptionPresenterImpl for more details.




andyhot wrote:
> in pageBeginRender of your custom exception page,
> check if the execption is of type UnAuthenticatedException
> and if it is, throw it again!
>
> Phillip Rhodes wrote:
>   
>> Yes, I am using that feature for "Unchecked" exceptions.  I just have some
>> a checked exception (UnAuthenticatedException) that I would like to catch
>> in my filter and this filter will send a redirect to the sso server.
>>
>> I don't want to do this globally for all exceptions.  Just my one
>> exception "UnAuthenticatedException"
>>
>> However, thanks for your response.
>>
>>
>>   
>>     
>>> Why not create your own exception page?
>>>
>>> You can define a method
>>> public void setException(Throwable value) { ... }
>>> and Tapestry will call this before activating your exception page.
>>>
>>>
>>>
>>>
>>> Phillip Rhodes wrote:
>>>     
>>>       
>>>> I have a checked exception that is thrown from various listeners in my
>>>> tapestry app.  I was hoping that I could use a servlet filter to catch
>>>> these specific exceptions in order to deal with them.
>>>>
>>>> Is this just something that is impossible to do within the tapestry
>>>> framework due to tapestry having to catch all exceptions for it's error
>>>> reporting/interfacing with the servlet spec...
>>>>
>>>>
>>>> thanks.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>>       
>>>>         
>>> --
>>> Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
>>> Tapestry / Tacos developer
>>> Open Source / J2EE Consulting
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>     
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>   
>>     
>
>
>   


-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 


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


Re: catch custom exception generated in tapestry app in filter?

Posted by andyhot <an...@di.uoa.gr>.
in pageBeginRender of your custom exception page,
check if the execption is of type UnAuthenticatedException
and if it is, throw it again!

Phillip Rhodes wrote:
> Yes, I am using that feature for "Unchecked" exceptions.  I just have some
> a checked exception (UnAuthenticatedException) that I would like to catch
> in my filter and this filter will send a redirect to the sso server.
>
> I don't want to do this globally for all exceptions.  Just my one
> exception "UnAuthenticatedException"
>
> However, thanks for your response.
>
>
>   
>> Why not create your own exception page?
>>
>> You can define a method
>> public void setException(Throwable value) { ... }
>> and Tapestry will call this before activating your exception page.
>>
>>
>>
>>
>> Phillip Rhodes wrote:
>>     
>>> I have a checked exception that is thrown from various listeners in my
>>> tapestry app.  I was hoping that I could use a servlet filter to catch
>>> these specific exceptions in order to deal with them.
>>>
>>> Is this just something that is impossible to do within the tapestry
>>> framework due to tapestry having to catch all exceptions for it's error
>>> reporting/interfacing with the servlet spec...
>>>
>>>
>>> thanks.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>>       
>> --
>> Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
>> Tapestry / Tacos developer
>> Open Source / J2EE Consulting
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   


-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 


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


Re: catch custom exception generated in tapestry app in filter?

Posted by Phillip Rhodes <sp...@rhoderunner.com>.
Yes, I am using that feature for "Unchecked" exceptions.  I just have some
a checked exception (UnAuthenticatedException) that I would like to catch
in my filter and this filter will send a redirect to the sso server.

I don't want to do this globally for all exceptions.  Just my one
exception "UnAuthenticatedException"

However, thanks for your response.


> Why not create your own exception page?
>
> You can define a method
> public void setException(Throwable value) { ... }
> and Tapestry will call this before activating your exception page.
>
>
>
>
> Phillip Rhodes wrote:
>> I have a checked exception that is thrown from various listeners in my
>> tapestry app.  I was hoping that I could use a servlet filter to catch
>> these specific exceptions in order to deal with them.
>>
>> Is this just something that is impossible to do within the tapestry
>> framework due to tapestry having to catch all exceptions for it's error
>> reporting/interfacing with the servlet spec...
>>
>>
>> thanks.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
>
> --
> Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
> Tapestry / Tacos developer
> Open Source / J2EE Consulting
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


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