// Make sure we found the url
URL url = null;
try {
url = FileUtil.searchForFile(key, ".jsf");
} catch (IOException ex) {
throw new LayoutDefinitionException(
"Unable to locate '" + key + "'", ex);
}
if (url == null) {
throw new LayoutDefinitionException(
"Unable to locate '" + key + "'");
}
// Read the XML file
LayoutDefinition ld = null;
String baseURI = getBaseURI();
try {
ld = new XMLLayoutDefinitionReader(url, getEntityResolver(),
getErrorHandler(), baseURI).read();
} catch (IOException ex) {
throw new LayoutDefinitionException("Unable to process '"
+ url + "'. EntityResolver: '" + getEntityResolver()
+ "'. ErrorHandler: '" + getErrorHandler()
+ "'. baseURI: '" + baseURI + "'.", ex);
}