Very quick question:

Does the Velocity generator work just as well as the JXTemplate generator?

I may end up using Velocity templates\generator instead of JXTemplate, but I'm a bit wary of this because the Velocity generator isn't mentioned very often in the cocoon doc.. :)

Regards,
Thomas Kjeldahl Nilsson



Nicolas Bielza wrote:

I don't know about the JXTemplate generator, but you may want to try the
Velocity generator which does access object methods (if they are
public).

Regards,
Nicolas.


-----Original Message-----
From: Thomas Kjeldahl Nilsson [mailto:[EMAIL PROTECTED] Sent: 14 juin, 2004 07:49
To: [EMAIL PROTECTED]
Subject: Tricky question (?) re. JXTemplate accessing object functions,
not values



Hey again-

Problem: I've got a java object with a 'String getText(String id)' method. This object acts as an abstraction of a database
(the database contains text content in different languages.)


Now, what I would like to do is send this java object to the jxtemplate generator, and in each jxtemplate access javaobject.getText(id) directly, like this:

${javaobject.getText("Submit_btn_txt")}

Now of course this doesn't work, since the jxtemplate generator is only able to access data directly through the variables of an object, not its

functions. (Right?)

The only other alternative I'm able to see right now is

A: constructing a java object hardcoded with all the possible getText() element in public variables, or
B: for each jxtemplate, construct a smaller object with only the needed subset of data variables for the current template.


Either way, not an elegant solution given a huge (and growing) database of elements!! Any immediate thoughts\suggestions on the problem?


Regards, Thomas Kjeldahl Nilsson


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to