HttpServletRequest req = (HttpServletRequest) actionContext.get(ServletActionContext.HTTP_REQUEST);
HttpServletResponse res = (HttpServletResponse) actionContext.get(ServletActionContext.HTTP_RESPONSE);
// prepare velocity
velocityManager.init(servletContext);
VelocityEngine velocityEngine = velocityManager.getVelocityEngine();
// get the list of templates we can use
List<Template> templates = templateContext.getTemplate().getPossibleTemplates(this);
// find the right template
org.apache.velocity.Template template = null;
String templateName = null;
Exception exception = null;
for (Template t : templates) {
templateName = getFinalTemplateName(t);
try {
// try to load, and if it works, stop at the first one
template = velocityEngine.getTemplate(templateName);
break;
} catch (IOException e) {
if (exception == null) {
exception = e;
}