T
T
TonyJa2018-05-25 10:25:03
JavaScript
TonyJa, 2018-05-25 10:25:03

Why mustache doesn't see the String type?

I have an entity with fields:

private int id;
private String name;
private String description;
private int price;
private int stock;

When I try to display them on the page:
{{#products}}
{{id}}
{{name}}
{{description}}
{{price}}
{{stock}}
{{/products}}

It gives me an error: com.samskivert.mustache.MustacheException$Context: No key, method or field with name 'name'.
If we remove the name and description fields from the output, then everything works fine, but I need these fields.
Tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TonyJa, 2018-05-25
@TonyJa

I solved the problem by adding null checks to the getter.
Thanks Sergey Gornostaev , prompted the answer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question