|
From: Darren D. <da...@da...> - 2004-03-12 16:35:17
|
If a controller handles the response completely it should return a null
ModelAndView to the dispatcher to indicate as such and prevent the
dispatcher attempting to render a view.
In such a case, is it appropriate that the dispatcher still attempts to
call the postHandle() method of any Interceptors in the chain? It seems
redundant to me - it also means every postHandle() method in every
Interceptor implementation has to explicitly check for a null MAV to avoi=
d
throwing an NPE.
I'm unsure if there are valid use cases that would require a postHandle()
to execute if the controller has fully handled the response (ie with a
response.sendError(...)
How about amending line 381 of DispatcherServlet thus:
if (mappedHandler.getInterceptors() !=3D null && mv !=3D null) {
--=20
Darren Davison
Public Key: http://www.davison.uk.net/key.jsp
|