Re: freemarker error: Expected hash, evaluated instead to ...

Jake Ochs <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
A TemplateModel...
On 12/16/2009 9:45 AM, Daniel Dekany wrote:
> Wednesday, December 16, 2009, 2:03:10 PM, Jake Ochs wrote:
>
>> I've created a custom collection that implements iterator and returns
>> another custom object - NotesDocWrapper (wraps a Lotus Domino Document
>> object.) My template then lists the docs collection I placed in the root
>> hash and iterates over the doc accessing a field like so:
>> <#list docs as doc>
>> <li>${doc.Subject}</li>
>> </#list>
>> The NotesDocWrapper implements TemplateModel and has a get method so it
>> can return a Notes Document field using the standard template dot syntax
>> as used above. I've used the NotesDocWrapper by itself, dropping it into
>> the root hash successfully, but when I attempt to nest it in this manner
>> I get a freemarker exception (see full stacktrace at bottom of post)
>>
>> How do I prevent Freemarker from expecting a hash instead of using the
>> wrapper I supplied for the nested object? (assuming this is the problem)
>> Any tips are appreciated.
>
> Exactly what does NotesDocWrapper extend and implement? It should
> implement TemplateHashModel (or TemplateHashModelEx).
>



------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
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.