I believe the reason (it's been awhile) that I overrode 'cleanup' is because I didn't want the exception to be rethrown. Off the top of my head, I'm not sure if that will suppress the redirect or not, but I wanted the distinct behavior of my filter "handling" the exception.
Basically, the way that 'afterCompletion' is invoked feels more like a 'finally' and what I wanted was a 'catch'. However, like I said, it's been awhile, and there's a chance that I completely misjudged how that would play out. -Jared On 08/10/2011 04:06 PM, Les Hazlewood wrote: > Jared's solution is definitely the right way to think of this, but I'd > personally override the 'afterCompletion' method in the AdviceFilter > superclass instead of 'cleanup'. > > 'cleanup' calls 'afterCompletion' in all cases, and will additionally > handle any extraneous/unexpected exceptions that might be thrown from > 'afterCompletion'. And there is no need to call super.foo. In this > way I think it is a bit safer/more convenient to override > afterCompletion rather than cleanup. This is just my preference > however. > > Cheers, > > Les
