velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles N. Harvey III" <charl...@alloy.com>
Subject RE: Regd. Objects
Date Tue, 12 Mar 2002 18:57:48 GMT
Vanitha,
This should do it.  It is usually the problem when people write in with
these problems....


PUBLIC class test
{
     ListName[] getNames()
     {
          returns  Names;
     }
}

PUBLIC class ListName
{
     String getName()
     {
          return "aa";
     }
}


Charlie

> -----Original Message-----
> From: Vanitha.S@lntinfotech.com [mailto:Vanitha.S@lntinfotech.com]
> Sent: Tuesday, March 12, 2002 1:55 PM
> To: velocity-user@jakarta.apache.org
> Subject: Regd. Objects
> 
> 
> Hi,
>      An array of test object is being passed to the put() method of the
> context object. PLs. let me know how can i invoke the getName() method in
> the template.
> 
> I am stuck up at one point
> 
> in Servlet i had given this statement
> 
>           Context.put("Test", objTest );
> 
> in the template
> 
> #foreach($TestInfo in $Test)
> 
> $TestInfo.getNames() // is it possible to store it in a user 
> defined object
> 
> #end
> class test
> {
>      ListName[] getNames()
>      {
>           returns  Names;
>      }
> }
> 
> class ListName
> {
>      String getName()
>      {
>           return "aa";
>      }
> }
> Thanks and Regards
> Vanitha
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:velocity-user-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message