Re: New freemarker user
Daniel Dekany <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Friday, May 1, 2009, 3:32:09 AM, Aoxa wrote:
>
> Hi all!
> I'm a new freemarker user and I'm trying to understand how to join a java
> pojo to a ftl. I'm trying to understad how to use the beanswrapper but can't
> find a suitable example. How can I define a ftl to work with a certain java
> class?
>
> something like:
>
> java:
> class test{ string user}
>
> ftl:
> <h1>Hello ${test.user}</h1>
>
>
> and a mapper class...
>
> (some overhead was stripped to make it simpler)
Well, well do you stuck? Just drop that Java Bean into the data-model
with name "test", and if it has a Java Bean property (which is not to
be confused with public field) called "user", which is a String, then
it should work like in the above template.
> Thanks!
> Pedro Zuppelli
--
Best regards,
Daniel Dekany
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf