Central exception handling using a custom RequestCycleListener
Hi there, we’d like to implement a centralized exception handling strategy for backend/service calls from with within Wicket components. Therefor I thought it could be a good idea to do this in a custom org.apache.wicket.request.cycle.AbstractRequestCycleListener#onException implementation. Depending on the caught exception we’d potentially like to do some cleanup logic (i.e. call methods on the currently requested page). I’m not sure what is the best strategy to get the page instance in onException, and what about ajax requests? And hints or pointers? Cheers, -Tom signature.asc Description: Message signed with OpenPGP using GPGMail
Re: Central exception handling using a custom RequestCycleListener
Hi, You may use another IRequestCycleListener to track the last processed page - org.apache.wicket.request.cycle.PageRequestHandlerTracker Martin Grigorov Wicket Training and Consulting On Wed, Feb 19, 2014 at 5:53 PM, Tom Götz t...@decoded.de wrote: Hi there, we’d like to implement a centralized exception handling strategy for backend/service calls from with within Wicket components. Therefor I thought it could be a good idea to do this in a custom org.apache.wicket.request.cycle.AbstractRequestCycleListener#onException implementation. Depending on the caught exception we’d potentially like to do some cleanup logic (i.e. call methods on the currently requested page). I’m not sure what is the best strategy to get the page instance in onException, and what about ajax requests? And hints or pointers? Cheers, -Tom
Re: Central exception handling using a custom RequestCycleListener
Nice, I’ll have a look at that thingy ;-) Thanks, -Tom On 19.02.2014, at 16:56, Martin Grigorov mgrigo...@apache.org wrote: Hi, You may use another IRequestCycleListener to track the last processed page - org.apache.wicket.request.cycle.PageRequestHandlerTracker Martin Grigorov Wicket Training and Consulting On Wed, Feb 19, 2014 at 5:53 PM, Tom Götz t...@decoded.de wrote: Hi there, we’d like to implement a centralized exception handling strategy for backend/service calls from with within Wicket components. Therefor I thought it could be a good idea to do this in a custom org.apache.wicket.request.cycle.AbstractRequestCycleListener#onException implementation. Depending on the caught exception we’d potentially like to do some cleanup logic (i.e. call methods on the currently requested page). I’m not sure what is the best strategy to get the page instance in onException, and what about ajax requests? And hints or pointers? Cheers, -Tom signature.asc Description: Message signed with OpenPGP using GPGMail