IOException retValue;
Throwable rootCause = ex.getRootCause();
if (rootCause != null) {
// Replace the ServletException with an IOException, with the root
// cause of the first as the cause of the latter.
retValue = new TilesIOException(message, rootCause);
} else {
retValue = new TilesIOException(message, ex);
}
return retValue;
}