> On Mon, 8 Jan 2001, Didier Dubois wrote:
>
> > Hi all,
> >
> > Is it possible to call Python methods from a velocity template, the way
> > it is done calling Java'ones.
> > How can we do that?
>
> You can write modules in python i.e. actions/navigations/screens/layouts
> in python but you can't execute arbitrary methods written
> in python in a velocity template unless you actually use the
> jython (use to be called jpython) compiler to make bytecode
> classes.
>
> There is no python interpreter in use in Velocity i.e. Velocity
> doesn't know how to look anywhere to execute methods in
> python scripts. Hope this helps. Leon will also probably
> be able to answer your questions better because he wrote
> the code that allows modules to be written in python :-)

As Jason said the Jython (or JPython) module is only for creating assembler
(screen, layout, action, etc.)  code at the moment.  As far as I know the
Jython was fully ported to Java and that the Jython types are Java Objects
under the covers.  I suspect that if you create a Jython screen you could
the Python objects to your Velocity context and use it from there, but I'm
not sure of this at all.  I've never tried it, but if you do please let me
know.  Should be interesting!

~ Leon



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to