velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barbara Baughman <baugh...@utdallas.edu>
Subject Re: problem accessing extended methods from template
Date Mon, 12 Dec 2005 22:40:16 GMT
Class B needs to be public

public class B extends A {

Class A needs to be public

public Class A {

Barbara Baughman
X2157

On Mon, 12 Dec 2005, john oh wrote:

> Hello,
>
> I have a class (B) that extends another (A) like so
> ===============================================
> class A{
> protected String str = "A";
> public String doA()
> return this.str;
> }
>
> class B extends A{
> }
> ===============================================
>
> In my template, I use the inherited method doA(), but this does not
> work. It doesn't print "A"
> ===============================================
> template.tpl
> $b.doA()
> ===============================================
>
>
> I'm probably doing something wrong here. Can anyone see a problem with this?
>
>
>
> Thank you,
> John
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

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


Mime
View raw message