// indicative of as serious problem...)
Template template = null;
try {
template = Velocity.getTemplate(templateFile);
} catch( ResourceNotFoundException rnfe ) {
throw new TuboResourceException("Velocity template "+templateFile+" can't be founded",rnfe);
} catch( ParseErrorException pee ) {
throw new TuboResourceException("Velocity parsing error procesing template "+templateFile,pee);
}
//
// Now have the template engine process your template using the
// data placed into the context. Think of it as a 'merge'
// of the template and the data to produce the output stream.
StringWriter writer = new StringWriter();
if ( template != null)
template.merge(context, writer);
//
// flush and cleanup
writer.flush();
writer.close();
buffer.append(writer.toString());
} catch (Exception e) {
throw new TuboResourceException("Error creating spring definition",e);
}
return buffer;
}