Commit 759a55d3 authored by Matija Obreza's avatar Matija Obreza
Browse files

VelocityEngine needs configuration

parent 1103e104
......@@ -27,6 +27,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;
import org.apache.velocity.app.VelocityEngine;
import org.genesys2.server.model.EntityId;
import org.genesys2.server.model.impl.ActivityPost;
import org.genesys2.server.model.impl.Article;
......@@ -62,6 +63,10 @@ public class ContentServiceImpl implements ContentService {
@Autowired
private HtmlSanitizer htmlSanitizer;
@Autowired
private VelocityEngine velocityEngine;
@Override
public Locale getDefaultLocale() {
return Locale.getDefault();
......@@ -268,7 +273,7 @@ public class ContentServiceImpl implements ContentService {
/**
* Merge data and template
*/
Velocity.evaluate(context, swOut, "log tag name", templateStr);
velocityEngine.evaluate(context, swOut, "log tag name", templateStr);
System.out.println(swOut);
return swOut.toString();
}
......
......@@ -39,4 +39,15 @@
</property>
</bean>
<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
<property name="velocityProperties">
<value>
resource.loader=class
class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
velocimacro.permissions.allow.inline.local.scope
runtime.log.logsystem.log4j.logger=velocity
runtime.log.logsystem.class=org.apache.velocity.runtime.log.Log4JLogChute
</value>
</property>
</bean>
</beans>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment