Re: [Freemarker-devel] New Methods in TemplateListModel
Generates text that depends on changing data (like dynamic HTML).
Brought to you by:
revusky
From: Nicholas C. <nj...@so...> - 2001-02-24 01:45:07
|
Hi David, First of all, I assume you mean the listSize() method and the get(int) method. If you don't implement these, the only thing that will break under FreeMarker 1.5.3 would be the ability to retrieve an item from a list using a numerical index. For instance, using an example from the manual, myList[1] myList[index] would both fail, since they require a call to the get(int) method to return something sensible. Hope this helps, Nicholas. ru...@us... ----- Original Message ----- From: "Crane, David" <David.Crane@TMS.TM3.COM> To: <fre...@li...> Sent: Saturday, February 24, 2001 10:43 AM Subject: [Freemarker-devel] New Methods in TemplateListModel > I am resurrecting some old code that used freemarker 1-4-8, in order to > upgrade to freemarker 1-5-3 and try out the preliminary version of the > freemarker.taglib package. > > There are two new methods in interface freemarker.template.TemplateListModel > -- listSize and size. Although their purpose is obvious, neither is > documented extensively. Actually implementing these would require that the > entire list is loaded/loadable into memory. My question is whether I can > punt in my implementation, say by throwing a TemplateModelException? > > My application is processing a result set from a database, and returns one > row at a time, using the hasNext and next methods. (There are actually more > optimizations than that.) My rewind method throws a TemplateModelException, > so that seems the sensible thing to do. > > Comments? Am I likely to break anything with this approach? > > David Crane > > _______________________________________________ > Freemarker-devel mailing list > Fre...@li... > http://lists.sourceforge.net/lists/listinfo/freemarker-devel > |