Discussion:
[FreeMarker-user] Display list item in freemarker page
anjibman
2013-05-09 19:07:14 UTC
Permalink
Hi I have a DTO as follow
class MyDTO {

String name
java.Util.Date acctCreatedDate
List<County> activeCountyList
}

In ftl I have

<#if name??> ${name} <#else> Test </#if>
<#if acctCreatedDate??> ${acctCreatedDate} </#if>
<ul>
<#list activeCountyList as activeCounty>
<li>${activeCounty.label}</li>
</#list>
</ul>

"name" is displayed OK.
"acctCreatedDate" is displayed as "Fri Apr 26 15:37:29 EDT 2013". How can I
display as "26/04/2013"?
For list I am getting error
Expected collection or sequence. achievements evaluated instead to
freemarker.ext.beans.StringModel

Any help is appreciated.

Thanks




--
View this message in context: http://freemarker.624813.n4.nabble.com/Display-list-item-in-freemarker-page-tp4654544.html
Sent from the freemarker-user mailing list archive at Nabble.com.
Barrie Selack
2013-05-09 22:37:50 UTC
Permalink
http://freemarker.sourceforge.net/docs/ref_builtins_date.html

Here are possible date formatting options

Where is activeCounty.label defined> What does your Country bean look like?

Barrie
Post by anjibman
Hi I have a DTO as follow
class MyDTO {
String name
java.Util.Date acctCreatedDate
List<County> activeCountyList
}
In ftl I have
<#if name??> ${name} <#else> Test </#if>
<#if acctCreatedDate??> ${acctCreatedDate} </#if>
<ul>
<#list activeCountyList as activeCounty>
<li>${activeCounty.label}</li>
</#list>
</ul>
"name" is displayed OK.
"acctCreatedDate" is displayed as "Fri Apr 26 15:37:29 EDT 2013". How can I
display as "26/04/2013"?
For list I am getting error
Expected collection or sequence. achievements evaluated instead to
freemarker.ext.beans.StringModel
Any help is appreciated.
Thanks
--
View this message in context: http://freemarker.624813.n4.nabble.com/Display-list-item-in-freemarker-page-tp4654544.html
Sent from the freemarker-user mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
FreeMarker-user mailing list
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Loading...