if (LOG.isDebugEnabled()) {
LOG.debug("Render request recieved for definition '" + definitionName + "'");
}
Definition definition = getDefinition(definitionName, request);
if (definition == null) {
if (LOG.isWarnEnabled()) {
String message = "Unable to find the definition '" + definitionName + "'";
LOG.warn(message);
}
throw new NoSuchDefinitionException(definitionName);
}
if (!isPermitted(request, definition.getRoles())) {
if (LOG.isDebugEnabled()) {
LOG.debug("Access to definition '" + definitionName
+ "' denied. User not in role '"
+ definition.getRoles());
}
return;
}
AttributeContext originalContext = getAttributeContext(request);
BasicAttributeContext subContext = new BasicAttributeContext(originalContext);
subContext.addMissing(definition.getAttributes());
pushContext(subContext, request);
try {
if (definition.getPreparer() != null) {
prepare(request, definition.getPreparer(), true);
}
String dispatchPath = definition.getTemplate();
if (LOG.isDebugEnabled()) {
LOG.debug("Dispatching to definition path '"
+ definition.getTemplate() + " '");
}
request.dispatch(dispatchPath);
// tiles exception so that it doesn't need to be rethrown.
} catch (TilesException e) {