Re: Determining which BeansWrapper was used to wrap an object in the data model

Rebecca Younes <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <C99D5C79.38B4%[email protected]>
You are absolutely right. That is exactly what I need.

>
>
>Message: 6
>Date: Tue, 1 Mar 2011 18:13:25 -0800
>From: Attila Szegedi <[email protected]>
>Subject: Re: [FreeMarker-user] Determining which BeansWrapper was used
>        to      wrap an object in the data model
>To: FreeMarker-user <[email protected]>
>Message-ID: <[email protected]>
>Content-Type: text/plain; charset="us-ascii"
>
>Most objects implement TemplateHashModelEx, with which you can enumerate
>the available keys. Wouldn't that be sufficient for your needs?
>
>Attila.
>
>On Feb 21, 2011, at 2:22 PM, Rebecca Younes wrote:
>
>> My Configuration uses a BeansWrapper with exposure level
>>EXPOSE_PROPERTIES_ONLY to wrap template model objects by default.
>>Sometimes I use a more permissive wrapper to wrap specific objects. When
>>retrieving the data model from the template processing environment (for
>>example, inside a Java directive called from the template), is there any
>>way to determine which type of wrapper was used to wrap a particular
>>object, so that I can determine which methods of the object are
>>available to the template? I've looked at methods of DeepUnwrap and
>>don't see anything that serves this purpose.
>>
>> Thank you.
>>
>> Rebecca Younes
>


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
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.