Re: Map models in 2.4 and 2.3.14
Daniel Dekany <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Friday, December 12, 2008, 8:10:24 PM, Grégory Joseph wrote: > Hi, > > In http://freemarker.sourceforge.net/docs-24pre1/ > versions_2_4_pre1.html, I read the following: > Warning, backward incompatible change! The default of > simpleMapWrapper property of BeansWrapper is true now. This means that > the methods and fields of Map-s will not be exposed by default, only > the pure key-set will define the subvariables of the templates. Note > that the default object wrapper of FreeMarker always had > simpleMapWrapper set to true, so if you have used only the default > object wrapper, then there is no change for you. > > However, if I look at the code of DefaultObjectWrapper, Map instances > are wrapped in SimpleHash, instead of either of MapModel or > SimpleMapModel (which BeansWrapper would do if DefaultObjectWrapper > would give it a chance) > > Am I missing something obvious? Maybe the "default object wrapper" is > actually *not* the DefaultObjectWrapper class ? > > Thanks for shedding light on this. I made a mistake in the version history there. The point was that the default wrapper didn't expose the Map methods in 2.3.x either, so most users are not affected. Only I forgot about this SimpleMapModel VS SimpleHash mess, which is AFAIK just a historical heritage, but fixing it would break too much code... I guess. Anyway, thanks for reporting this, I will fix it. -- Best regards, Daniel Dekany ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/