• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

extending velocity

 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are the typical extension points provided by velocity? I mean something like the way struts allows us to plug in our request processor etc.
What are the reasons someone might want to extend velocity..again some practical examles would help. Say am using velocity with struts / Spring, i guess that would mean that someone has already extended velocity for me so that it can be easier to make it work with struts/spring. But are there likely to be situations when i would have to extend velocity further?
 
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not quite sure what these extensions would be. I have for example an automatic context build, but this is very specific to my scenarios.

./pope
 
Author
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Karthik,

There are a few ways to extend Velocity and the template processing pipeline.

You can hook into template processing using event handlers.

Velocity works against the Context interface so you can implement your own Context if you want. This is quite useful for building an adaptor to some other model data source.

You an encapsulate simple template fragments into Velocity macros and you can use your own tools to provide additional utilities.

If you find that macros and tools don't do what you want, then you can hook in custom directives using the user directive approach.

Rob
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks rob for a detailed explanation. I shall probably try out a couple of things that you have suggested
 
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic