Getting extra newline while rendering .txt template

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Getting extra newline while rendering .txt template

q9929t
Hi,
I have this text template which I am processing using thymeleaf

[# th:if="${grade} and ${grade} > 0"]
The following [(${grades})] were successfully associated to a student:
 [# th:each="sub : ${subList}"]
    [(${sub})][/][/]
[# th:if="${failure} and ${failure} > 0"]
The following [(${failure})] files failed in getting associated:
 [# th:each="file : ${fileList}"]
    [(${file})][/][/]
[# th:if="${success} and ${Success} > 0"]
The following [(${success})] files are in successful":
 [# th:each="file : ${successFileList}"]
    [(${file})][/][/]

The problem is, if multiple if conditions are false, extra newline is rendered for each false if statement. However, I want only one new line and then the output of the if statement with true.

Can somebody help me?