velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@adeptra.com>
Subject Re: methods are overseen
Date Thu, 22 Aug 2002 12:43:05 GMT
On 8/22/02 7:01 AM, "Friedrich Bergmann" <bergmann@ananzi.co.za> wrote:

> hello velocity world,
> 
> i have just started trying to use velocity in a
> professional context.
> everything seems to be fine, for one simple, fatal,
> horrible problem:
> 
> velocity does not call the functions of the classes i put
> into the Context.
> 
> simple values are fine, and overriding the toString()
> function of the class that otherwise fails also works.
> 
> i have tried everything, now i need HELP. why is this not
> working!?
> 
> details:
> 
> class VeloXML {
>  public VeloXML(){}
> 
>  public String Na="nu";
>  public String getNa(){
>     return Na;
>  }
>  
>  public void setNa(String val){
>     Na=val;
>  }
>   
>  public String toString(){
>      return "hoho";
>  }  
> 
> ...
>  context.put("nana",this);
> ...
> }
> 
> 
> THE TEMPLATE
> ${nana}
> ${nana.Na}
> $nana.Na
> ${nana.Na()}
> ${nana.getNa()}
> ${nana.getNa}
> GENERATES
> hoho
> ${nana.Na}
> $nana.Na
> ${nana.Na()}
> ${nana.getNa()}
> ${nana.getNa}
> 
> so only the toString() function works.
> this cannot be right.

Make the class public.  ToString() overrides the public method in the public
base class Object, so that works.

> 
> thanks in advance,
> friedrich
> 
> ==
> Find businesses and have your business found: http://www.brabys.com
> 
> --
> To unsubscribe, e-mail:   <mailto:velocity-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:velocity-dev-help@jakarta.apache.org>
> 

-- 
Geir Magnusson Jr. 
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



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


Mime
View raw message