Questions tagged [apache-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
1answer
46 views
+150

AppSync GraphQL mutation server logic in resolvers

I am having issues finding good sources for / figuring out how to correctly add server-side validation to my AppSync GraphQL mutations. In essence I used AWS dashboard to define my AppSync schema, ...
0
votes
1answer
21 views

How retrieve client selection from HTML select tag that is populated with info from database?

I've populated a tag with data from the db with this code: <select name="course"> <!-- This uses Velocity Template Language. This code loops through --> <!-- the map of the ...
0
votes
1answer
22 views

How do I declare field variable of tested class using apache velocity?

I'm trying to setup intellij idea code template for JUnit4 Test Class so that when I create the test it will also generate a field variable in the test. Example : public class FooTest { private ...
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 ...
1
vote
1answer
30 views

Dot after Reference in Body Mapping Template (AWS API Gateway)

Is it possible to use a dot directly after a reference in API Gateway's Body Mapping Templates? I do string concatination like this: #set($region ="us-east-2") #set($apiid ="$context.apiId") #set($...
0
votes
1answer
46 views

Apache Velocity - if clause

I use Apache Velocity for create an e-mail template. I have a mail message that contain a table with a list of elements, for create it I had used a #foreach. In this table I'll add a column contained ...
1
vote
0answers
171 views

How to add image as an 'inline attachment' with Apache Velocity and JavaMail

I know this question resembles to this question here. But, I am using a different email methodology with Spring Framework so adding a new question. I have an image stored at /tmp/upload/image path in ...
0
votes
0answers
74 views

Apache Velocity not rendering CSS transform tag

I am trying to rotate the obtained image using CSS. I have checked the same using plain vanilla HTML CSS and the image is indeed being rotated. Below is my code for the same : CSS : .transform-...
0
votes
0answers
14 views

Apache-velocity getting NullPointerException while init [duplicate]

I am working on generating pdf with apache-velocity.As same as docs,I followed the config and init.please check my init code below private void initVelocityEngine() { Properties properties = new ...
1
vote
1answer
47 views

apache velocity to ignore \n in token?

Is there a way to tell apache velocity to ignore \n in tokens? For the following password token (line number 2) The output is on line number 6 and 7 update someone marked this as Duplicate, its ...
0
votes
0answers
73 views

Display chinese characters as it is from velocity file [duplicate]

We are using Apache Velocity framework to store email template format in .vm files. Those emails have chinese character content. When retrieved in Java and displayed as String, the chinese characters ...
1
vote
1answer
305 views

Polarion ALM SDK API getWorkItem()

I have a question about the Polarion SDK API I am in a Project -> Documents and Pages -> Testing. From there I created a new wiki article. In the editing of the article I did the following: 1) ...
1
vote
2answers
157 views

Velocity with double curly braces

Why velocity gives the following output for the string VelocityContext vc = new VelocityContext(); vc.put("foo", "bar"); String inString ="THis is ${{foo}} and this is ${foo}.Hello and ${foo}-Hello";...
1
vote
2answers
302 views

Passing javascript variable to velocity variable templete

I have installed xwiki successfully and able to generate wiki pages using velocity template language. Could anyone please tell me that how can I pass javascript varible to velocity templete. I have ...
0
votes
1answer
201 views

How to create a sublist from List<Object> in apache velocity template .vm

I am new to apache velocity, I want to create a subList Object from the List Objects which are coming from some service call in .vm file. We need to render the list based on some logic in parts, for ...
0
votes
1answer
190 views

Importing Apache Velocity in IntelliJ Idea

I am using the IntelliJ IDEA on a mac and want to import Apache Velocity. In my pom.xml file: <dependencies> <!-- https://mvnrepository.com/artifact/org.apache.velocity/velocity --> ...
1
vote
1answer
154 views

Spark Velocity - Unable to Load Resources (“org.apache.velocity.exception.ResourceNotFoundException”)

Starting out on Spark and currently trying to use templates via Velocity based on the documentation on http://sparkjava.com/documentation#views-and-templates. I'm however having some errors. Aug 22, ...
1
vote
2answers
214 views

Using Apache Velocity (with SparkJava) with loaded templates

I am building a website using Spark + Velocity. This has HTML components that are very similar across the webpages of the site, so I have put my shared components in some templates that I dynamically ...
0
votes
1answer
171 views

Apache Velocity - Failed to eval script due to slf4j dependencies

Continue previous question I'm failing to execute scripting in velocity 2.0, I use jars: velocity-engine-scripting-2.0.jar, velocity-engine-scripting-2.0.jar, commons-collections-3.2.2.jar I'm ...
1
vote
1answer
129 views

Apache Velocity 2.0 Scripting Compilable not working

I'm trying to check velocity scripting engine 2.0 which Provide JSR 223 implementation and support of Compilable the Compilable interface has been implemented in the process. I use jars: velocity-...
0
votes
1answer
97 views

JMeter add velocity language to JSR 223 Sampler

I want to use velocity language as Scripting language in JMeter's JSR 223 Sampler. According to the list velocity can be used in JSR223, According to the answer velocity should be added to JMeter ...
1
vote
3answers
546 views

Velocity Template not able to parse and display data in html format

I have a simple email program written in Java and Spring with Velocity template to format data that sends email which should be displayed in html format. However, it just displays the data along with ...
0
votes
3answers
1k views

org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'templates/email/test.vm'

My code as follow. VelocityEngine ve = new VelocityEngine(); ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "class"); ve.setProperty("class.resource.loader.class", "org.apache....
0
votes
1answer
327 views

Spring velocity template email?

I have below velocity template. <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <style> table, th, td { ...
237
votes
9answers
132k views

What is a classpath?

I was just reading this line: The first thing the format() method does is load a Velocity template from the classpath named output.vm And I couldn't figure out what was meant by classpath in this ...