Ah, now I see what you mean. Yes, the whole thing could stand to be a bit
more "pluggable", and in particular BEANS_WRAPPER.wrap(value) would be a
better choice than new ScalarModel(value).
The workaround is to manually wrap your POJOs before putting them in an
attribute map, but that's a pain and can lead to trouble. I avoid the whole
issue by adding an interface HasTemplate that my template-representable
POJOs implement:
public interface HasTemplate {
String templateName();
}
and registering a custom ConverterHelper that converts POJOs that implement
HasTemplate into TemplateRepresentations using the name returned by
templateName(). Any request/response information that my template will need
can be provided via the POJO.
--tim
On Tue, Mar 6, 2012 at 4:50 PM, Dencel <[email protected]> wrote:
> I should be more clearer, I mean the variable value as a result from the
> attributemap of request/response.
>
> TemplateModel values are detected, but pojo instances placed on the
> attributemap can't be used in the template (they are wrapped by
> ScalarModel).
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2931580
>
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2931978