HttpServletResponse response = servletTilesContext.getResponse();
ServletContext servletContext = (ServletContext) servletTilesContext
.getContext();
RequestDispatcher rd = servletContext.getRequestDispatcher(url);
if (rd == null) {
throw new PreparerException(
"Controller can't find url '" + url + "'.");
}
try {
rd.include(request, response);
} catch (ServletException e) {
throw new PreparerException(
"The request dispatcher threw an exception", e);
} catch (IOException e) {
throw new PreparerException(
"The request dispatcher threw an I/O exception", e);
}
} else {
throw new PreparerException("Cannot dispatch url '" + url
+ "' since this preparer has not been called under a servlet environment");
}
}