diff --git a/spark-template-velocity/pom.xml b/spark-template-velocity/pom.xml index 3f3c701..b0ac482 100644 --- a/spark-template-velocity/pom.xml +++ b/spark-template-velocity/pom.xml @@ -40,8 +40,8 @@ org.apache.velocity - velocity - 1.7 + velocity-engine-core + 2.0 com.sparkjava diff --git a/spark-template-velocity/src/main/java/spark/template/velocity/VelocityTemplateEngine.java b/spark-template-velocity/src/main/java/spark/template/velocity/VelocityTemplateEngine.java index 8005c28..1aead3a 100644 --- a/spark-template-velocity/src/main/java/spark/template/velocity/VelocityTemplateEngine.java +++ b/spark-template-velocity/src/main/java/spark/template/velocity/VelocityTemplateEngine.java @@ -75,12 +75,13 @@ public VelocityTemplateEngine(VelocityEngine velocityEngine) { * {@inheritDoc} */ @Override + @SuppressWarnings("unchecked") public String render(ModelAndView modelAndView) { String templateEncoding = Optional.ofNullable(this.encoding).orElse(StandardCharsets.UTF_8.name()); Template template = velocityEngine.getTemplate(modelAndView.getViewName(), templateEncoding); Object model = modelAndView.getModel(); if (model instanceof Map) { - Map modelMap = (Map) model; + Map modelMap = (Map) model; VelocityContext context = new VelocityContext(modelMap); StringWriter writer = new StringWriter(); template.merge(context, writer);