Questions tagged [velocity]

Apache Velocity is a Java-based template engine. It can be used to dynamically generate web pages, email messages, source code, or any other text file.

1
vote
2answers
27 views

spring-boot 2.0.6 velocity view issue with resource-loader-path property

When vm file is located in classpath:/templates/hello.vm, everything works fine on spring-boot-1.5.x. When the vm file is located classpath:/templates/hello.vm or moved to the classpath:/template/...
1
vote
2answers
19 views

java.lang.NoClassDefFoundError: with log4j velocity custom layout

I am writing a custom layout for log4j appender with velocity, but I am unable to get it to run the error below: java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties ...
0
votes
1answer
10 views

velocity template engine 1.7 line break issue

I have a velocity template that generates a Java class and, it's gobbled with new line breaks and this doesn't happen always. My template looks like this, #foreach( $str in $elm.mylist ) #if($...
0
votes
0answers
19 views

real time integrating acceleration to get velocity in simulink

Hi everybody It is sometime Im searching some solutions for my problem but still unclear. I have seen some of the codes to integrate the acceleration data to get velocity but they are mainly for ...
1
vote
1answer
28 views

Velocity Template for generating custom IntelliJ toString method

Given the class public class TestClass { private static List<TestClass> tmp = new ArrayList<>(); private String test1 = ""; private String test2 = ""; private String ...
0
votes
0answers
14 views

maven fails when creating archetype

I tried to creat a project in IntelliJ IDEA using Maven quickstart archetype but it allways failed: [ERROR] ResourceManager.getResource() parse exception [ERROR] org.apache.velocity.exception....
0
votes
1answer
29 views

I want an Object lerping in the y-axis to move along the Z-Axis?

I'm currently making a runner type game that is not randomly generated in Unity. The player, camera and background stay in the same place (the player movement is clamped) and the hazards come towards ...
0
votes
1answer
45 views

Javascript Regex to replace any non-alphanumeric characters, including brackets

I have this regex /[\W_]+/g that I use to remove any non-alphanumeric characters. However it does not remove brackets. What I need is for it to remove any kind of bracket/paranthesis so that a ...
0
votes
0answers
11 views

Atlassian Confluence: Load macro in Velocity .vmd file doesn't work, but I have the right name. Problem?

I installed the plugin „Page Fields for Confluence“. But I want to load the macro „page-field-value-by-name“ in a Velocity .vmd file, and that’s not working. I did it like this in „page.vmd“ template ...
1
vote
0answers
22 views

How can i create or use an svg file with velocity engine?

I use Velocity engine to generate a pdf file and I am trying to create a signature. I use a svg file for the signature and I want it to be part of my output pdf file. Therefore i first tried to ...
1
vote
0answers
21 views

Losing formatting while sending mail

I am using velocity VelocityContext context = new VelocityContext(); context.put("commentText", commentText); context.put("link", link); When I put commentText the formatting is maintained that is ...
0
votes
1answer
31 views

Velocity showing dollar sign after changing from struts 1.3 to struts 2.5

Im stuck in velocity file, migrating from struts 1.3 to struts 2.5, after migrate to struts 2.5, I unable to see record from App layer. It's showing dollar sign(you can refer to image. I will post my ...
0
votes
0answers
23 views

java.lang.VerifyError on org.apache.velocity.app.VelocityEngine

We've been working on a long application server migration project, almost finished the technical parts, we've been through the test process of the entire USER_STORIES and we keep getting some bad ...
1
vote
1answer
19 views

Velocity Template Language: Connect two conditions in one #elseif() statement

In my example the parameters are: $p2.length which has the value "0" and the boolean $suspectYesNo which is set to "false". I would expect, that in my code the second #elseif will run due to my ...
1
vote
1answer
34 views

Velocity in Unity 2D How to get velocity of object without rigidbody

By using method transform.translate(Vector3.left * 5f * Time.Deltatime; does this change the velocity of a gameobject with a rigidbody ,because in my case it doesnt work.Is there a way i can move an ...
0
votes
1answer
36 views

Trigger Apache Velocity #set Parameter using a button (HTML / JS)

Is it possible to trigger a Velocity Template Language #set value to parameter via a button? I am trying to combine HTML, JS and Velocity doing the following: #set($ld=$pageParameters....
0
votes
0answers
24 views

NPE when rending velocity template using toolboxConfigLocation for Spring boot+Velocity Project

I got an existing SpringMVC+velocty project, and tried to upgrade it to SpringBoot+Velocity, as a dozens of velocty templates here. First, everything works in my eclipse environment, and I can visit ...
0
votes
0answers
14 views

How to escape a “ ” in velocity

So my velocity is working fine if user sends 'lorem' just fine, it also works great if he sends lorem but when he sends "lorem" it breaks, is there any way that I can escape both " from that result ...
1
vote
0answers
30 views

How to use a text file in Velocity

I have a text file with name data.txt which includes Customer's details. I need to send a Msg to each Customer using apache velocity. My file look like this enter code here First_Name, City, ... ...
0
votes
0answers
24 views

Using Apache Velocity for template SQL

I want to use Apache Velocity Template Engine to generate SQL query based on the input. Any sample snippet to get started would be helpful. JSONObject keysObject = new JSONObject(); ...
0
votes
1answer
23 views

Checkbox Value is reversed based on data that user enters, JavaScript needs to know when it is checked

Good Evening, I have a scenario where users are checking a box to enter a row of data (or update a row of data) in a MySQL database via SparkJava/ Java. Everything is working as expected except for ...
0
votes
2answers
35 views

Javascript not getting Value from Checkbox in Veleocity for (This) Record in HTML

Still really new at Javascript/ jQuery. Here's the scenario... I am using Velocity Template Engine to generate my HTML page. I have custom check boxes on the page that are shaped with Font Awesome ...
0
votes
1answer
23 views

In velocity report script ,how to find if the user name is already present?

In a for loop, the variable $dispNames gets updated with user first name and last name. set( $dispNames = $dispNames + $user.firstName + " " + $user.lastName + ", ") How do I check if ...
0
votes
0answers
39 views

How to properly handle 2D tiled collision with fake movement?

I'm trying to implement collision detection on my Java 2D Tiled game. This is my first attempt on game development, so please don't mind the messy code. The following method checks the user input and ...
0
votes
2answers
26 views

Replace tag in Apache velocity in java

Haven't used Apache velocity, but in current project, we use this library to populate data into templates. would like to ask if it is possible to replace tag inside template, using Velocity? I have ...
0
votes
1answer
18 views

JavaScript MouseOver is only working for the first instance in the Velocity #foreach statement

I'm still fairly new to to JavaScript. Sorry in advance. I have some HTML and a Velocity Template Engine #foreach statement to render some html from a database. The idea is to mouse over the rendered ...
0
votes
0answers
18 views

Hibernate/Velocity Macro Issue

Fix: So it seems like there was an issue in the VM file. When adding an entity collection to another entity collection the VM files #if check to see if the object assignment existed or not failed. ...
1
vote
2answers
29 views

Dollar and exclamation mark (bang) symbols in VTL

I've recently encountered these two variables in some Velocity code: $!variable1 !$variable2 I was surprised by the similarity of these so I became suspicious about the correctness of the code and ...
0
votes
1answer
37 views

Get Movement Translation Difference on swiping left a frame beyond a fixed point then changing direction by swiping right to update the frame

The scenario is as the following: User taps and holds down finger to swipe a UIView to left to reveal another view beneath. The visible view is scrollable 50 points to left and then it stops. View's ...
0
votes
1answer
41 views

Why Apache Velocity cannot handle multiple dot keys

I dont get this while using Apache Velocity 1.7. When I have a vm like this db.connection.url = $db.customer.environment.db_url and a context like this... VelocityContext context = new ...
0
votes
0answers
31 views

Unity Networking: Object has velocity, but not moving

This is for a 2.5D / orthographic view game. Basically, each player can fire a projectile. this projectile should have a fixed velocity until it hits a target (no drag, no gravity). I originally had ...
0
votes
0answers
56 views

How to calculate forward speed, using MPU-6050?

I am improving a project, however, I'm stuck in while trying to calculate the forward speed (velocity) from MPU-6050(The kit I use is Nodemcu). I can get acceleration and gyro data with a good ...
0
votes
2answers
40 views

Set animator float according to object's horizontal movement speed

Hey I am currently making a very simple 3D endless runner game and I am trying to make a animator float increase when the characters speed increases. I'm using a very simple code to make the ...
0
votes
0answers
15 views

Change ASTText nodes in the velocity template

I need to parse my velocity template and each time there is a ASTText - to change its value (let's say to set *** instead of ASTText). I created my custom visitor that extends BaseVisitor public ...
1
vote
1answer
47 views

Velocity Templates - No “#break” in “#foreach” loops [duplicate]

I was doing some brief reading about Velocity template syntax. Specifically I am trying to create content which is rendered conditionally by the template engine. To be even more specific, I want to ...
0
votes
2answers
255 views

Could not find org.springframework.boot:spring-boot-starter-velocity

I'm new to spring and trying to use velocity with spring boot. Here is my build.gradle repositories { mavenCentral() } plugins { id 'org.springframework.boot' version '2.0.4.RELEASE' } ...
1
vote
1answer
25 views

differentiate int and double in intellij template

I am defining a custom toString template in IntelliJ. IntelliJ offers a template system based on the Velocity scripting language. Great stuff ! But I am facing a particular issue with it right now. I ...
0
votes
1answer
40 views

Does Apache Velocity support searching for templates recursively?

Velocity config resource.loader = file file.resource.loader.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader file.resource.loader.path = /path/to/templates Folder Structure ...
0
votes
1answer
42 views

Encoding in email send using Velocity template

I am sending email using velocity template in Rusian language, the mail receiving with junk character. The mail template. <html> <body> <h3>Dear ${name}, <br/>Greetings ...
0
votes
0answers
24 views

Showing time as Eastern Time in Velocity template

My Server time is in UTC. However, I need to show the time as Eastern time. In jsp (jstl), I am using the code: <fmt:formatDate pattern="MM-dd-yyyy HH:mm:ss" value="${user....
1
vote
1answer
30 views

Users information in Xwiki

I would like to get information such as first name and surname from the profile of the users in Xwiki.How can I do? Thanks.
1
vote
1answer
42 views

Apache VTL - How to find an item in an array

I am trying to use VTL for the first time and cannot see to get arrays to grab an inputted String. I have tried "in" (but I do not believe this is a key word in this language), as well .contains() ...
1
vote
1answer
31 views

Apache Velocity #parse a file if it exists

I'm working with Apache Velocity and I'm trying to include another .vtl file. The problem is that this file is not nessacery to have. #parse("${PROJECT_NAME}-variables.vtl") I was hoping I could ...
1
vote
1answer
42 views

Find and remove regex string in Velocity

I've created a Live Template with IntelliJ IDEA and I'm trying to find and remove a specific String within Velocity through a variable but failed I tried to set $moduleName variable through $NAME ...
0
votes
1answer
33 views

Velocity trim() method

For example $xcontext.user -> Xwiki.user.trim('Xwiki') "XWiki." How can I remove the expression? I tried this but it did not work.
0
votes
0answers
28 views

AES encryption using Apache Velocity script

For a project I'm looking to encrypt email addresses in a Velocity script. We are looking to encrypt the email address with a shared key in one system and using that key to decrypt the email address ...
0
votes
1answer
14 views

How to get more information about generic Velocity exception

I have an Exception rendering #parse(<template_name>) in my Tomcat logs (catalina.out) from time to time. The problem is that it happens once every few days and I don't know how to get more ...
0
votes
2answers
22 views

Xwiki automatically increment number page title in Application

enter image description here Hi I would like to add an automatic increment to the head of my application. For example; "Permission Certificate #1", "Permission Certificate #2", "Permission ...
0
votes
1answer
29 views

Velocity Variable(use together string and integer variables)

How can I use String and Integer variables it together in "Velocity"? #set ($var1 ="exp"+1) I tried a few times but I could not. Any help will be highly appreciated.
0
votes
1answer
85 views

Velocity js for scale 1

I literally just started learning jquery and velocity at the same time for animation purposes. I was reading the velocity.js docs and trying to manipulate the "scale" of my box and ran into some ...