Questions tagged [jinjava]

Java-based template engine based on django template syntax, adapted to render jinja templates (at least the subset of jinja in use in HubSpot content). Currently used in production to render thousands of websites with hundreds of millions of page views per month on the HubSpot COS.

Java-based template engine based on django template syntax, adapted to render jinja templates (at least the subset of jinja in use in HubSpot content). Currently used in production to render thousands of websites with hundreds of millions of page views per month on the HubSpot COS.

GitHub: https://github.com/HubSpot/jinjava

12 questions
2
votes
2 answers

How to make JinJava throw error if it can't find a binding

I need to use JinJava to process small templates that can contain different tokens. For example: Hello,{{ user }}... where a binding user is required because without it the output does not make any sense. My class does not know what tokens template…
Yuriy Tseretyan
  • 1,676
  • 16
  • 17
1
vote
1 answer

Trying to increment counter in Jinja2

I am trying to increment a counter variable to print the numbers one to six {% set counter = 1 %} {% for i in range(3) %} {% for j in range(2) %} {{ counter }} {% set counter = counter + 1 %} {% endfor %} {% endfor…
ryu.h
  • 11
  • 1
1
vote
1 answer

Jinja2 unescaping the sequence

I am working on a jinja2 template in python where autoescape=true flag is required due to privacy constraint. Since the autoescaping is enabled, jinja template ouputs the ascii value i.e >> instead of >> symbols. Is their a way where I can…
Himanshu
  • 21
  • 1
1
vote
0 answers

Is there any way of registering a class in jinjava?

I just started using jinjava. I need to access a list or an array of the next class in the jinjava template: class Interface { public String interfaceName; public String interfaceDesc; public String interfaceIP; public String…
1
vote
1 answer

Jinjava first app java.lang.ClassNotFoundException

I'm trying to create jinjava application: src/main/java/com/company/Main.java package com.company; import com.hubspot.jinjava.Jinjava; public class Main { public static void main(String[] args) { Jinjava jinjava = new Jinjava(); …
aranel
  • 191
  • 1
  • 1
  • 8
1
vote
0 answers

Runtime parameters using jinjava

Let's suppose I have a Jinja template and I want to see what are the parameters in this template that need to supplied during rendering to render the template. How to do this using Jinjava by Hubspot? I am using Jinjava 2.1.10. The functionality I…
0
votes
1 answer

How to pass Java String value or list of strings to javascript using JINJAVA

We can access java values passed through JINJAVA in HTML using {{}}. How can we access the same in javascript?
0
votes
1 answer

Render lists using jinjava library

Is it possible to render lists using jinjava library? So far I could only render HashMaps. I'm using the following function to convert case classes to hashmaps. def toNestedJavaMap(caseClass: AnyRef): util.Map[String, Any] = (new…
JaviOverflow
  • 1,434
  • 2
  • 14
  • 31
0
votes
1 answer

Where can i find values for variable parameters of jinja template of hadoop-env obtained using ambari api?

I am working with ambari api to fetch config files for different services. But, the ambari api results in jinja template for many files( like hadoop-env, hive-env etc. ). I need to replace values for variable parameters in jinja template in order to…
0
votes
0 answers

JinJava on App-Engine

Does JinJava work on AppEngine? If so, what do I have to do to set it up? For instance, where do I put the template files so I can access them without getting an IOException? What gradle dependencies do I need? I am using Android Studio for…
Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199
0
votes
1 answer

JinJava Uncaught exception from servlet due to logger

Trying to use JinJava on App-Engine, I get the following exception Uncaught exception from servlet java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at com.hubspot.jinjava.util.Logging.(Logging.java:23) at…
Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199
-1
votes
1 answer

Why are the values of the dict in the list is not printing out?

So I want to loop across several list each hasving one or multiple dictionaries. For Example given: r = [{"symbol":10},{"symbol":15},{"symbol":25}] h = [{"sy":15},{"sy":23},{"sk":64}] i = [{"sl":45},{"sl":67},{"sl":98}] I want it to…