I am using FTL file as front end. I need add objects into one list and check that list for empty. How I need to add the list?
You can check using following that list is empty or not ?
[#if dto??]
//inside it write all your code
[/#if]
here dto
is name of list
send from your controller
.
To iterate list :
<#list dto as dtoList>
<tr>
<td>${dtoList.var1}</td> <td>${dtoList.var1}</td>
</tr>
</#list>
here dto
is class that sent from controller
and that have 2 fields: var1
and var2
.
Still Problem Post me.
look Here my answer.
To check if myList
is empty:
[#if myList?size != 0]
not empty
[#else]
empty
[/#if]
To check if myList
is empty or missing ( null
):
[#if dto?has_content]
not empty
[#else]
empty
[/#if]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.