Questions tagged [pebble]

Pebble is a lightweight, open source, Java EE template engine.

Pebble is a java template engine inspired by Twig. It separates itself from the crowd with it's inheritance feature and it's easy-to-read syntax. It ships with built-in auto-escaping for security, and it includes integrated support for internationalization.

40 questions
1
vote
1 answer

Pebble template inheritance fails without error

I'm using Pebble template engine with Spring Boot 2, and everything works fine until I start using inheritance. The browser shows an empty page, no content is returned at all. And unfortunately the server and Catalina (I'm using Tomcat 8.5) logs…
BigJ
  • 1,990
  • 2
  • 29
  • 47
1
vote
1 answer

Controlling whitespace in Pebble templates

I'm having a hard time getting the whitespace control the way that I want in a Pebble template. I'm currently generating JSON using Pebble, but this problem and my use case is not specific to JSON (or else I would use a JSON library, such as Jackson…
Nathan Ward
  • 560
  • 5
  • 16
1
vote
0 answers

Pebble Template Get Object from Key

So I have some experience with Pebble template syntax, however I'm having an issue trying to retrieve an entry from a Map by the key, and because the Pebble documentation isn't very intuitive, I've been spinning my wheels trying to figure out the…
MikeH
  • 11
  • 1
1
vote
1 answer

Pebble template phone number format

I wanted to format phone number which is passed as a string/number. I need to format that number to phone number like Input to pebble template "5554781123". Output should be like "555.478.1123". How do i format that number to phone number?
suresh
  • 341
  • 2
  • 3
  • 13
1
vote
1 answer

Cannot use for tag to iterate through Array List in Pebble Template Engine

I have been trying to iterate through an Array List of items with {% for item in items %} syntax to no avail. Keeps throwing java.lang.UnsupportedOperationException at java.util.AbstractMap.put(AbstractMap.java:209) at…
javabot
  • 173
  • 10
1
vote
1 answer

Lazy evaluation of variables/interpolations for Pebble/Freemarker

Say I have a template in either pebble or freemarker (The two engines I am considering using). It might look something like this:
AdamBourke
  • 53
  • 1
  • 9
0
votes
0 answers

TimeOuts on Individual Threads

I am running a web scraping task where I run multiple scrapers concurrently. Sometimes my scraper gets stuck non-deterministically and there is nothing I can do about that. What happens is, after a while the entire script is stuck. I am running a…
0
votes
1 answer

filtering dependency-track vulnerabilities notification

I have a dependency-track server that sends notifications to email for all new vulnerabilities. I would like to send notifications only for critical vulnerabilities. In the pebble templates, I would like to have something like this: {% if…
Aliou
  • 21
  • 2
0
votes
2 answers

Does Pebble templating engine provide any methods to manually designate i18n locale

I am using Pebble to process mail content, and it works great, usually I make it getting locale from environment variables: @Autowired private Environment env; PebbleTemplate template = pebbleEngine.getTemplate(templateName); Writer writer = new…
0
votes
1 answer

ACME Client Implementation

I am currently working on my own ACME client implementation. I generated the following JWS: {"protected":…
0
votes
1 answer

How to pass or get the value from Map (random generator) to PebbleStringBody in Gatling with Scala

How to pass or get the value from Map (random generator) to PebbleStringBody in Gatling with Scala val names = Iterator.continually { Map("name" -> s"PerfTest ${Random.alphanumeric.take(10).mkString}") } .feed(names) …
0
votes
1 answer

pebble autoescape json - unicode entities

when I use {% autoescape "json" %} { "key" : "hellü" } {% endautoescape %} the result is { "key" : "hell\u00FC" } But I dont want the strings encoded to unicode entities when I'm already creating a utf8 text file with this json string in…
DubZ
  • 580
  • 3
  • 12
0
votes
0 answers

Pebble/Twig Templates: Rendering twice(i.e. nested templates)?

Is there a way to render a template twice? For example: {{ myTemplate }} where in my templating context, myTemplate => "{{ 2 + 2 }}" so the final output will become 4? In another words: "{{ myTemplate }}" => "{{ 2 + 2 }}" => "4" Is something like…
HelloWorld
  • 109
  • 2
  • 9
0
votes
2 answers

Pebble templating for YAML file

I am trying out Pebble templating for a config file which is in YAML format. The value for this comes from another YAML file. That is - value.yml contains:- server: - box1: host:"12345" config.yml contains:- server: …
0
votes
0 answers

How to bind Java object to HTML form using Spring MVC and Pebble template engine

I am having trouble getting Pebble template engine to display Java object values in HTML form in a HTTP GET request. In Pebble template I have a form like this.