You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Naveen <an...@india.hp.com> on 2004/02/07 11:35:53 UTC
How to invoke a user defined method from a class in a vm file.
Hi
can anyone clear my doubt.
I have created a class called mail.i have 4 methods in it.From a .vm
file I need to call these methods and pass parameters through these
methods how will I do it.
Please Help me.
With regards
Naveen
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
Re: How to invoke a user defined method from a class in a vm file.
Posted by Stijn de Witt <St...@chello.nl>.
You have to place the object of class mail you want to call methods on in
the context. You can do this in buildNormalContext(), by using code like
this:
context.put("myObject", myObject);
Then, in the .vm file, the object is available as the name you gave as key,
plus the dollar sign, and you can then call methods on it:
$myObject.callMethod();
Check out chapter 7 of the tutorial.
-Stijn
----- Original Message -----
From: "Naveen" <an...@india.hp.com>
To: <je...@jakarta.apache.org>;
<je...@jakarta.apache.org>; <po...@yahoogroups.com>
Sent: Saturday, February 07, 2004 11:35 AM
Subject: How to invoke a user defined method from a class in a vm file.
> Hi
> can anyone clear my doubt.
> I have created a class called mail.i have 4 methods in it.From a .vm
> file I need to call these methods and pass parameters through these
> methods how will I do it.
>
> Please Help me.
>
> With regards
> Naveen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org