Logan -
What'd you do differently in your version of VRW? Can you submit a patch (to
Solr's JIRA) if it fixes something?
Thanks!
Erik - (author of VRW)
On Jun 2, 2011, at 10:06 , Logan Stinger wrote:
> I'm using velocity 1.6.4 as packaged with Solr. So everything is going
> through the VelocityResponseWriter which is also part of Solr. I was adding
> objects to the context using response.add("name" value); and in the
> VelocityResponseWriter the Solr response is added to the VelocityContext but
> it appears as though the object goes through some serialization prior to
> getting added. I just made my own version of VelocityResponseWriter and it
> solved the issue. Thanks for your help.
>
> -----Original Message-----
> From: Nathan Bubna [mailto:[email protected]]
> Sent: Wednesday, June 01, 2011 10:48 PM
> To: Velocity Users List
> Subject: Re: Custom Java Object stored in Velocity Context
>
> Well, i've got no problems getting Velocity to call public methods on
> instances of publicly declared classes. Got any more info you can share?
> Like the class in question? Velocity version? Log messages?
> Anything?
>
> On Wed, Jun 1, 2011 at 7:53 PM, Logan Stinger <[email protected]> wrote:
>> The class is very simple right now, public class with 5 public getters and
> setters. Nothing else to it. I've tried sticking a few other classes in
> the context to test them. I have been unable to get anything but the
> toString representation of any of them.
>>
>> On Jun 1, 2011, at 5:15 PM, Nathan Bubna wrote:
>>
>>> 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-60F2FA11
>>>> F07D");
>>>>
>>>> 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]
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]