That wouldn't really work, because some of the objects may have a late
loading semantic.
A CMP2 bean with CMR fields for example.
If I toString()ed it, I'd
1) lose all the unique fields
2) never get CMR data

Plus, the data map is sent from the client, so it's too late once the MBean
gets it.

Anyone know if calling an MBean in VM with the client passes pointers?  Or
does it serialize?

I would expect, that this kind of service would really need to be on every
app server instance anyway.

-David Budworth

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ken
Jenks
Sent: Monday, October 29, 2001 4:36 AM
To: Jboss-Development
Subject: Re: [JBoss-dev] Templating services


You could try using each object's toString() method and merging that with a
Velocity template at run-time. Use the MBean to associate each object with
a template. Every object already has a toString() method and a String is
already guaranteed to be serializable, so you're most of the way there.

That could be the default behavior. You could allow the programmer to
specify the name of the String method in the MBean, so you could use
MyObject.toWebMacroString() for one and MyObject.toVelocityString() for the
other, or add support for different template engines in the future. For
example, I usually have a toXML() method in my objects and I could use that
to send the object straight through a template to a Web or WAP user without
having to go through a servlet or JSP front end.

>And auto-determin the template engine to use (WebMacro prefers .wm, and
>Velocity has some other extensions (I don't remember exactly which right
>now))

That would be ".vm".

-- Ken Jenks, http://abiblion.com/

    Tools for reading.


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to