freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remie (JIRA)" <>
Subject [jira] [Commented] (FREEMARKER-57) Cannot access children
Date Fri, 09 Jun 2017 15:32:18 GMT


Remie commented on FREEMARKER-57:

Problem sovled. You were right. My class Motor had default access.
Hence it could not cope with it. Now changed to public and it is all working fine. 

Thank you very much!

> Cannot access children
> ----------------------
>                 Key: FREEMARKER-57
>                 URL:
>             Project: Apache Freemarker
>          Issue Type: Bug
>          Components: engine
>            Reporter: Remie
>            Priority: Critical
> My situation: Create two classes Car and Motor in which class Car has a reference object
to Motor. Now while iterating through the system list it is possible to display all the values
> <li>${system_index + 1}.${} from and has a ${system.getMotor()}</li>
> The motor variable outputs its toString() method. However when trying to access the variable
of the motor name, like this:
> <li>${system_index + 1}.${} from ${system.developer} and has a ${system.getMotor().getName()}</li>
> FreeMarker outputs the following message:
> ==> ${system.getMotor().getName()} [on line 12, column 75 in helloworld.ftl]
> How can i access the variable getName of the Motor class?

This message was sent by Atlassian JIRA

View raw message