In Spring/Thymeleaf, it is possible for a controller to ask Thymeleaf to render part of a page declared as a th:fragment, e.g.:
@RequestMapping(value = "/guests", method = RequestMethod.GET)
public String showGuestList(Model model) {
model.addAttribute("guests", hotelService.getGuestsList());
return "results :: resultsList";
}
Where resultsList is defined inside a bigger Thymeleaf template as <div th:fragment="resultsList" th:unless="${#lists.isEmpty(guests)}" class="results-block">...</div>.
(As described here and elsewhere).
What would it take add the same functionality in spark? I'm willing to try it myself but don't know where to start.
When writing AJAX-heavy web pages I'm having to move all my th:fragments into separate HTML files, which breaks one of the benefits of using Thymeleaf and is a lot of effort.
In Spring/Thymeleaf, it is possible for a controller to ask Thymeleaf to render part of a page declared as a
th:fragment, e.g.:Where
resultsListis defined inside a bigger Thymeleaf template as<div th:fragment="resultsList" th:unless="${#lists.isEmpty(guests)}" class="results-block">...</div>.(As described here and elsewhere).
What would it take add the same functionality in spark? I'm willing to try it myself but don't know where to start.
When writing AJAX-heavy web pages I'm having to move all my
th:fragments into separate HTML files, which breaks one of the benefits of using Thymeleaf and is a lot of effort.