protected void service(final HttpServletRequest req, final HttpServletResponse resp)
throws ServletException, IOException
{
final ViewNameParser viewNameParser = new ViewNameParser(req.getPathInfo());
final View view = viewRegistry.getView(viewNameParser.getViewName());
if (view == null) {
throw new ErrorStatusException(HttpServletResponse.SC_NOT_FOUND, "Not Found", "View not found.");
}
final ViewRequest request = new HttpViewRequest(req, view.getConfig(), viewNameParser.getRemainingPath(),
req.getQueryString());
try {
view.dispatch(request).send(resp);
}
catch (Exception e) {
Throwables.propagate(e);
}
}