Re: Display String array in FTL

strutstwouser <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Yes, the array has data . I printed the same using Struts2 tag , like : 

<@s.property value="model.borrowers[0].party.legalAddress.addressLine[0]" />

and it gives the value fine.

The latest code i was trying was : 

<#if model.borrowers[0].party.legalAddress.addressLine?exists>

<#assign addressLines = model.borrowers[0].party.legalAddress.addressLine>

<#list addressLines as addressLine>							
							AddressLine0->	${addressLine}
</#list>
</#if>

This breaks with the error : 

freemarker.ext.servlet.ServletContextHashModel
 cause: freemarker.template.TemplateModelException: ?size is unsupported
for: freemarker.ext.beans.SimpleMethodModel





>>
>> There shouldn't be. Are you 100% sure the array has a first item which
>> is not Java null, etc.?
> 
> Oh, and even if you have one of those, it should still throw
> freemarker.core.InvalidReferenceException, not NPE. So... maybe the
> problem is not exactly there, just around somewhere?
> 
> 

-- 
View this message in context: http://www.nabble.com/Display-String-array-in-FTL-tp23632761p23639458.html
Sent from the freemarker-user mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.