}
public ViewResponse dispatch(final ViewRequest request) {
final HandlerContext context = new HandlerContext(request);
final Route route = router.findRoute(context);
try {
if (route == null) {
log.debug("No route found for request.");
return routeOfLastResort.dispatch(context);
}
return route.dispatch(context);
}
catch (Exception e) {
// Exceptions will get caught by a global filter and nicely reported as 500 errors.
throw Throwables.propagate(e);
}