Questions tagged [handlebars.java]

Handlebars.java is a modern and full featured template engine and a java port of [handlebars]. It provides the power necessary to build semantic templates with the same syntax as [mustache]

64 questions
0
votes
0 answers

Why value of JSON changes “:” to “=” in Helper class

The template is created in Handlebars JS. and to process in Java jknack handlebars is used. I wrote helper class to assign value in a variable through enum syntax. I got inspiration from enum NumberHelper and write my own enum VarHelper. Here is…
sadia
  • 305
  • 1
  • 7
  • 18
0
votes
2 answers

Why am I getting a null value when I pass the argument which is displayed already?

I am trying to use handlebars in spring-mvc using helper functions. Below is my html handlebar template: \{{index}} \{{dev_name}} {{#equality dev_name "a"}}
Devanshi
  • 77
  • 1
  • 10
0
votes
1 answer

Why is Synchronize called in vertx's Handlebars library?

I am trying to understand why a synchronized block is used in this method from the vertx handlebars library io.vertx.ext.web.templ.handlebars.impl.HandlebarsTemplateEngineImpl class: @Override public void render(Map context, String…
jstur
  • 659
  • 6
  • 12
0
votes
1 answer

Intellij: Running jar from maven dependancy

I am new to maven, I have some .hbs (handle-bar template files), I have "handlebars-proto", which includes premade handlebar server. https://github.com/jknack/handlebars.java (search for handlebars-proto) I've added the dependency to my pom.xml…
user1064504
  • 573
  • 6
  • 16
0
votes
1 answer

HandleBars doesn't render object variables

I'm having the following problem when trying to render some object's variables on handlebars: I've declared a static object public static class Banana { public static String name = "PAPI PAPI"; public static int id= 9; public Banana( ) …
0
votes
2 answers

Handlebar Java : Adding OR condition in if statement

How can I add an OR condition in handlebar using java? I want to do something like: {{#if condition1}} || {{#if condition2}} do something ..... ...... {{else}} do something else... {{/if}} Do I need to register some helper? For example for…
0
votes
1 answer

Unable to format the date in Handlebars.java using {{now}}

I am trying to render the present date using Handlebars in Java. While using the {{now}} handlebar, I am able to print the date as "Dec 8, 2017":
    {{#items}} {{name}} {{now}} {{/items}}
But when I try to format the date by…
0
votes
1 answer

How to create a custom list iterator helper for handlebars in java

I am using Handlebars for java from : https://github.com/jknack/handlebars.java I have a list of CustomObject and a template file template.hbs. I'm able to iterate over this list by using handle bars {{#each customList}} block. Now I want to iterate…
0
votes
1 answer

Vert.x file root versus Handlebars templates location

I'm constantly struggling with NoSuchFileException while trying to reach templates for HandleBars template engine for Vertx. Personally i think that ether Vertx file system root is inconsistent or I'm missing something, code snippet is following: …
Tomas
  • 3,269
  • 3
  • 29
  • 48
0
votes
2 answers

A boolean for a condition met for a list of data in Ember Cli component

I have a hbs that displays a table for the list of data that is fed to the component templates/components/results.hbs {{#each resultsDetail as |resultDetail|}} {{resultDetail.samples}} …
wingskush
  • 534
  • 1
  • 6
  • 22
0
votes
2 answers

Get the length of iterator list in handlebar java

Java code -- List table = Lists.newArrayList(); ........ Template Code -- {{#each table}}

{{table.length}}

{{table.size}}

Haoyu Chen
  • 1,760
  • 1
  • 22
  • 32
0
votes
1 answer

Loop in java handlebar template along with other parameters

I want to create a handlebar java template something like: "This is a sample template with {{parameter1}} {{#if object_list}} {{#each object_list}} {{object_list.somevar}} {{object_list.othervar}} {{/each}}{{/if}}" Before I could do…
Parag
  • 662
  • 9
  • 15
0
votes
1 answer

Use handlebars Java to iterate over a map of maps

I am currently creating a small Ratpack, Java, Groovy project. I am using Handlebars Java as my templating system. https://github.com/jknack/handlebars.java I am attempting to iterate over a map that has a key and then a map as a value. This is an…
N P
  • 2,319
  • 7
  • 32
  • 54
0
votes
2 answers

kSend JSON to template using handlebars java and ratpac

I am creating a test application that simply creates a JSON representation of an object and sends it to the template, I then want to use the JSON in a a JS script on the front end. I am using Ratpack and Java Handlebars to do this. Here is my…
pocockn
  • 1,965
  • 5
  • 21
  • 36
0
votes
1 answer

Handlebars doesn't render json

JSON it's pulling…
Rob
  • 88
  • 1
  • 14