You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Peter Lammich <la...@ls5.cs.uni-dortmund.de> on 2003/10/29 18:06:34 UTC
Registering event handlers via velocity.properties ?
I need to write a custom ReferenceInsertionEventHandler.
My problem is: I do not have the source code of the Servlet, so I do not
know how to get my EventHandler attached.
Can I modify one of the config files (web.xml, velocity.properties, or
similiar) to register my EventHandler as the
default event-handler for the ReferenceInsertionEvent ?
Or (less preferrable) can I attach the event-handler to the current
context via statements in the template that is just rendered ?
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: Registering event handlers via velocity.properties ?
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Wednesday, October 29, 2003, at 12:27 PM, Peter Lammich wrote:
> Geir Magnusson Jr. wrote:
>
>>
>> On Wednesday, October 29, 2003, at 12:06 PM, Peter Lammich wrote:
>>
>>> I need to write a custom ReferenceInsertionEventHandler.
>>> My problem is: I do not have the source code of the Servlet, so I do
>>> not know how to get my EventHandler attached.
>>> Can I modify one of the config files (web.xml, velocity.properties,
>>> or similiar) to register my EventHandler as the
>>> default event-handler for the ReferenceInsertionEvent ?
>>
>>
>> Funny you should ask.
>>
>> We are just talking about that - if we should add to the config the
>> ability to setup a handler. Can you actually config Velocity w/ that
>> servlet?
>
> That's the problem. I don't have any possibility to view the source of
> that weird servlet (some commercial closed-source stuff), and there is
> no (documented) configuration interface. I cannot even access the
> velocity context within my templates. I thoght about the following
> options:
> - Inserting the eventHandler via the properties file (see above)
If Velocity had that feature, you could do that by modifying the
default properties in the vel.jar
> - Modifying the velocity sources to look for my event handler
> upon initializing the renderer (I do not know the sources, so I
> probably would do something quick&dirty)
It might be easy
> - Just resigning
>
>
:)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
--
Geir Magnusson Jr 203-247-1713(m)
geirm@optonline.net
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: Registering event handlers via velocity.properties ?
Posted by Peter Lammich <la...@ls5.cs.uni-dortmund.de>.
Geir Magnusson Jr. wrote:
>
> On Wednesday, October 29, 2003, at 12:06 PM, Peter Lammich wrote:
>
>> I need to write a custom ReferenceInsertionEventHandler.
>> My problem is: I do not have the source code of the Servlet, so I do
>> not know how to get my EventHandler attached.
>> Can I modify one of the config files (web.xml, velocity.properties,
>> or similiar) to register my EventHandler as the
>> default event-handler for the ReferenceInsertionEvent ?
>
>
> Funny you should ask.
>
> We are just talking about that - if we should add to the config the
> ability to setup a handler. Can you actually config Velocity w/ that
> servlet?
That's the problem. I don't have any possibility to view the source of
that weird servlet (some commercial closed-source stuff), and there is
no (documented) configuration interface. I cannot even access the
velocity context within my templates. I thoght about the following options:
- Inserting the eventHandler via the properties file (see above)
- Modifying the velocity sources to look for my event handler upon
initializing the renderer (I do not know the sources, so I probably
would do something quick&dirty)
- Just resigning
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: Registering event handlers via velocity.properties ?
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Wednesday, October 29, 2003, at 12:06 PM, Peter Lammich wrote:
> I need to write a custom ReferenceInsertionEventHandler.
> My problem is: I do not have the source code of the Servlet, so I do
> not know how to get my EventHandler attached.
> Can I modify one of the config files (web.xml, velocity.properties, or
> similiar) to register my EventHandler as the
> default event-handler for the ReferenceInsertionEvent ?
Funny you should ask.
We are just talking about that - if we should add to the config the
ability to setup a handler. Can you actually config Velocity w/ that
servlet?
>
> Or (less preferrable) can I attach the event-handler to the current
> context via statements in the template that is just rendered ?
Ew :)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
--
Geir Magnusson Jr 203-247-1713(m)
geirm@optonline.net
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org