Header Ads

  • Breaking Now

    Velocity Framework

    What is Velocity Framework?
    Velocity is a Java based template engine.It permits anyone to use a simple yet powerful template language to reference objects defined in Java code.Velocity is inspired from 'WebMacro' , an alternative to JSP,PHP and ASP( www.webmacro.org).

    Where can Velocity be used?

    Velocity framework can be used in following areas:
    - Web apps, dynamic HTML pages are created and processed with VelocityViewServlet or number of frameworks that support Velocity
    - Source code generation
    - Automatic e-mails
    - XML transformation, provides an ant task called Anakia which reads an XML file and makes it available to a Velocity template.

    What are the features of Velocity?
    Velocity framework has following features:
    - Velocity is MVC based
    - It segregates HTML template code from Java code
    - It emphasizes on role based web app development
    - Velocity offers better maintainable web applications

    How Velocity works?
    When using Velocity in an application program or in a servlet (or anywhere, actually), you will generally do the following :
    - Initialize Velocity. This applies to both usage patterns for Velocity, the Singleton as well as the 'separate runtime instance', and you only do this once.
    - Create a Context object.
    - Add your data objects to the Context.
    - Choose a template.
    - 'Merge' the template and your data to produce the output.

    An Emailing template creation using Velocity framework
    Velocity With XML

    4 comments:

    1. This is very preliminary info on velocity framework.. Can you please mention some good site where I can find the details about the features and how to use them about velocity? Other than the user guild provided by : velocity.apache.org

      ReplyDelete
    2. Vaishali,
      As you are aware the most of Velocity info is available on velocity.apache.org, besides this you may refer following links:

      OnJavaWebsite
      Velocity on OSCON2007

      Advanced Velocity

      ReplyDelete
    3. Very useful info about Velocity framework. Thanks for sharing, it will help lot of java developers

      ReplyDelete
    4. Very useful info about Velocity framework. Thanks for sharing, it will help lot of java developers

      ReplyDelete

    Post Top Ad

    Post Bottom Ad