}
public static void handle(Controller controller, String mime, HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
Interceptor interceptor = controller.getInterceptor();
if(interceptor==null)
{
controller.handle(mime, request, response);
return;
}
boolean success = false;
try
{
success = interceptor.preHandle(getCurrentRequestContext());
}
finally
{
if(success)
{
try
{
controller.handle(mime, request, response);
}
finally
{
interceptor.postHandle(true, getCurrentRequestContext());
}
}
else
interceptor.postHandle(false, getCurrentRequestContext());
}
}