Answer the question
In order to leave comments, you need to log in
Handlebars java - why is there no output?
JSON available
{
"galerts": [{
"description": "Samsung Galaxy S7 EDGE SM-G935F Репутация: - 2542 +. Samsung SM-G935F Galaxy S7 Edge - Официальная прошивка (OS 6.0.1)",
"header": "131",
"url": "http:\/\/4pda.ru\/forum\/index.php?showtopic=732005"
}, {
"description": "Качаем ядро в телефон,заходим в twrp,нажимаем install и указываем где сохранили ядро,после установки можно делать очистку dalvik cache и ...",
"header": "Samsung SM-G935F Galaxy S7 Edge - Неофициальные прошивки",
"url": "http:\/\/4pda.ru\/forum\/index.php?showtopic=734979"
}, {
"description": "Сотовые телефоны. Цена: 49 900 р. Samsung Galaxy S7 Edge SM-G935F. Новый. В наличии. Мощнейший! Samsung Galaxy S7 Edge ...",
"header": "Samsung Galaxy S7Edge 32Гб! Новый! Гарант1год ДНС! Дешево!",
"url": "http:\/\/www.farpost.ru\/vladivostok\/tech\/communication\/cellphones\/moshnejshij-samsung-galaxy-s7edge-32gb-novyj-garant1god-dns-deshevo-obmen-47317873.html"
}, {
"description": "Купить Samsung Galaxy Note 5 32Gb (N9200) Duos. Android, экран 5.7\" AMOLED ... корзине покупок · Samsung Galaxy S7 Edge 32Gb (SM-G935F) ...",
"header": "Samsung Galaxy Note 5 32Gb...",
"url": "http:\/\/apervind.host.webasyst.com\/shop\/samsung-galaxy-note-5-32gb-n9200-duos\/"
}]
}
{{#each galerts}}
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">
{{header}}
</h3>
</div>
<div class="panel-body">
<p>{{description}}</p>
<a href="{{url}}" type="button" class="btn btn-info">Читать далее</a>
</div>
</div>
{{/each}}
TemplateLoader loader = new FileTemplateLoader("/var/www/GoogleAlerts/mail-html/", ".hbs");
Handlebars handlebars = new Handlebars(loader);
Template compiled = handlebars.compile("inlined-short");
System.out.println(compiled.apply(json_galerts.toJSONString()));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question