public TemplateExecutor(
final HttpServletRequest request, final HttpServletResponse response,
final ServletContext servletContext, final MessageSource messageSource,
final Locale locale, final ApplicationContext applicationContext,
final ConversionService conversionService) {
IWebContext context = new OfflineSpringWebContext(request, response, servletContext, applicationContext, conversionService);
// Model attributes
context.getVariables().put("product", DAO.loadProduct());
context.getVariables().put("productList", DAO.loadAllProducts());
context.getVariables().put("html", "This is an <em>HTML</em> text. <b>Enjoy yourself!</b>");
context.getVariables().put("customer", DAO.loadCustomer());
context.getVariables().put("customerName", "Dr. Julius Erwing");
context.getVariables().put("customerList", DAO.loadAllCustomers());
context.getVariables().put("genders", Gender.values());
context.getVariables().put("paymentMethods", PaymentMethod.values());
context.getVariables().put("price", DAO.loadAmount());
context.getVariables().put("releaseDate", DAO.loadReleaseDate());
context.getVariables().put("productId", 273);
context.getVariables().put("productName", "Red-carpet");
String templateMode = StandardTemplateModeHandlers.HTML5.getTemplateModeName();
SpringMessageResolver messageResolver = new SpringMessageResolver();
messageResolver.setMessageSource(messageSource);
executor = new StaticTemplateExecutor(context, messageResolver, templateMode);
}