problem about velocity-Collection of common programming errors
Franz
linux logging velocity
When instatiating Velocity I get this error (posted just the “caused by”-messages):java.lang.RuntimeException: Velocity could not be initialized! Caused by: org.apache.velocity.exception.VelocityException: Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration. Caused by: org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with t
Arne Evertsson
java web-applications velocity
Something is wrong and it is very frustrating. I read on velocity’s homepage that when I run a webapp then some properties should be set. And I’ve done that but no matter what I do I keep getting the same error. This is where I set the props and use velocitypublic class ConfirmationMailGenerator implements MailGenerator {private BasicUser user;private String htmlTemplate = “HTMLConfirmationMailTemplate.vsl”;private String plainTemplate = “PlainConfirmationMailTemplate.vsl”;public ConfirmationMa
Bozho
java jsp velocity tiles freemarker
I’m about to choose to way to organize my view (with spring-mvc, but that shouldn’t matter much)There are 6 options as far as I see (though they are not mutually exclusive):tiles sitemesh freemarker velocity <jsp:include> <%@ include file=”..”>tiles and sitemesh can be grouped; so can freemarker and velocity. Which one within each group to use is not a matter of this discussion, there are enough questions and discussions about it.This is an interesting read, but can’t quite convince
todofixthis
java velocity
When i try to initialize velocity engine usingVelocityEngine engine = new VelocityEngine(); engine.init();I encounter the same error when i tryVelocity.init();org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.ServletLogChute with the current runtime configuration.What may cause this exception?
Community
java liferay velocity
Are all vm files of the theme executed each time a page is requested? Maybe custom_init.vm is executed only once per session or some other optimizations occur?
bobber205
apache velocity
Wanting to do some fancy stuff… 😛 We’d like to be able to pass a string that IS the file, instead of a string that simple a filename. We’re going to create a file in memory using a string/stringbuffer and we want the velocity engine to act upon that instead of reading in a file.Does this function exist?Many thanks!
José Leal
java servlets log4j stack-trace velocity
I built a webapp that works perfectly fine in my localhost (tomcat). But when I tried to deploy, velocity crashes in init(), leaving me with this strange stack trace here (sorry for the size):ERROR [main] (VelocityConfigurator.java:62) – Error initializing Velocity! org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.at org.apache.velocity.runtime.log.LogManager.createLogChute(Lo
user1487380
javascript themes liferay portlet velocity
I try to include my customizing Navigation portlet to first column of my themes So I had tried to use following code in my layout template: (\ROOT\layouttpl\custom\3_columns.tpl)$velocityPortletPreferences.setValue(“portlet-setup-show-borders”, “false”) $theme.runtime(“71_INSTANCE_MAIN”, “”, $velocityPortletPreferences.toString()) $velocityPortletPreferences.reset() It work fine, expect, When enter Manage->Page, and select one pages in pages tree (diffrent of current page) then select Layout on
Bastl
java spring xslt velocity xdoclet
I am about to generate a reference documentation for a big bunch of spring-beans that are configured and assembled at runtime. The basis for the documentation is javadoc.In the first step I collect a map of classname <-> raw-class-documentation using a simple doclet.Then I launch the spring container and find all those beans that I am interested in.Now I want to render the documents, but I need guidance with toolset and data-modeling.1) The actual datamodel does not reflect what I want to doc
Jyothis
java string reflection velocity
Is there any String replacement mechanism in Java, where I can pass objects with a text, and it replaces the string as it occurs. For example, the text is :Hello ${user.name},Welcome to ${site.name}. The objects I have are “user” and “site”. I want to replace the strings given inside ${} with its equivalent values from the objects. This is same as we replace objects in a velocity template.
ema
spring view velocity
I have a spring mvc project.For views firstly i used jsp and it worked fine, but then i wanted to use velocity and got exception.Both views are similar except of syntax.I can’t understand why it happens. That’s my jsp:<form:form action=”updateDepartament” modelAttribute=”editDepartament” method=”POST”> <table> <tr><td>Id:</td><td><form:input path=”departamentId” readonly=”true”/></td></tr><tr><td><spring:m
Cory Kendall
java spring-mvc velocity
I try add javascript to my velocity template. <html><head> <title>:: $currency.CurrencyName Detail Info ::</title> </head><body> <table><tr><td>Name</td><td>$currency.CurrencyName</td></tr><tr><td>Jual</td><td><div id=”$currency.CurrencyName_buy”>$currency.Buy</div></td></tr><tr><td>Beli</td><td><div id=”$currency.CurrencyName_sell”>$curr
Lyudmil
java velocity
Our team has been experiencing a recurring problem with velocity templates. Upon rendering, some throw a RuntimeException with the message “Template.merge() failure – Unable to render Velocity Template, ‘/template.vm'”. We have not been able to reproduce the problem and the documentation on the web is pretty insufficient. The problem is not consistently reproducible – the same templates whose rendering sometimes causes the error also manage to display without problems at other times. The Templat
Mikaveli
java regex ascii velocity
I’m trying to remove undesirable characters from a string in Velocity (newlines are ok, but not things like EM and CAN ASCII control characters).#set($cleanScreen = $cleanScreen.replaceAll(“\p{Cc}”, “”))Throws:org.apache.velocity.exception.ParseErrorException: Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 13, column 82. Encountered: “p” (112), after : “\”\\”at org.apache.velocity.Template.process(Template.java:137)at org.apache.velocity.runtime.resource.
Web site is in building