TemplateModelException when unwrapping SimpleMethodModel

Rebecca Younes <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <CA5F3186.816D%[email protected]>
Hello,

I'm getting a TemplateModelException when I try to do DeepUnwrap.permissiveUnwrap() or DeepUnwrap.unwrap() on a SimpleMethodModel. The error is generated in the following code block, with the message "?size is unsupported for: freemarker.ext.beans.SimpleMethodModel". However, size() is defined for this class. What is going wrong, and is there a workaround so that I can get at the wrapped method?


        if(model instanceof TemplateSequenceModel) {

            TemplateSequenceModel seq = (TemplateSequenceModel)model;

            ArrayList list = new ArrayList(seq.size());

            for(int i = 0; i < seq.size(); ++i) {

                list.add(unwrap(seq.get(i), nullModel, permissive));

            }

            return list;

}


Thank you.


Rebecca Younes

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
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.