Controller tilesController = definition.getOrCreateController();
if (tilesController != null) {
ServletResponse response = (ServletResponse) externalContext.getResponse();
if (request instanceof HttpServletRequest && response instanceof HttpServletResponse) {
try {
tilesController.execute(tileContext, (HttpServletRequest) request,
(HttpServletResponse) response, servletContext);
} catch (Exception e) {
throw new FacesException(e);
}
} // else not executing controller for non-HTTP request/response (is this right??)