The class of the object and the method itself must be declared public.

On Wed, Jun 1, 2011 at 1:38 PM, Logan Stinger <[email protected]> wrote:

> I have the following code:
>
> …
>
> List<ICODocument> history =
> repository.getDocumentHistoryForId("8B2F2F53-7DEA-45B6-84BA-60F2FA11F07D");
>
> context.put("documentHistory", history);
>
>
>
> Then in my notes.vm file I have the following:
>
> #foreach($doc in $response.response.get("documentHistory"))
>
> $doc
>
> #end
>
>
>
> The rendered output is what I would expect.  However, I don’t want to see
> the toString() representation of my object.  I want to see the value of a
> particular method call on my object.
>
>
>
> So I changed my notes.vm to be this:
>
> #foreach($doc in $response.response.get("documentHistory"))
>
> $doc.isMax()
>
> #end
>
>
>
> In this case my rendered output is simply:
>
> $doc.isMax() $doc.isMax()
>
>
>
> I was under the impression that I could add any java object to the velocity
> context and call any method on that object in my velocity template.  Am I
> misunderstanding?
>
>
>
>
>
> *Logan Stinger*
>
> *[image: Description: bluelid_logo_small]*
>
> * *
>
> (515) 281-6702
>
> (515) 822-8212
>
> [email protected]
>
>
>
>
>

Reply via email to