tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kasmeroglu <daniel.kasmero...@kasisoft.net>
Subject Freemarker and CDI
Date Sat, 15 Nov 2014 13:43:34 GMT
Hi,

I intend to make my beans available in a Freemarker Template which means
that I have to implement a wrapper (TemplateHashModel) for this. Is
there already something similar like a bean wrapper that is capable to
deal with the proxied instance ?
To clarify a small example:

--begin Freemarker--
Dear Mr. ${currentCustomer.callName}
--end Freemarker

In my app I got a bean 'CurrentCustomer':

@Named @ManagedBean
@Data @FieldDefaults(PRIVATE)
public class CurrentCustomer {

  String   callName = "Joe";

  ...

} /* ENDCLASS */

In a Freemarker TemplateModel I can resolve 'currentCustomer' to a bean
(CdiEjbBean). Is there some sort of BeanWrapper available for this proxy
or is there any other solution to this ?

Best regards

Daniel Kasmeroglu

Mime
View raw message