Results 1 to 4 of 4

Thread: Spring + SiteMesh + Velocity?

  1. #1

    Default Spring + SiteMesh + Velocity?

    First, if this has been covered somewhere, please point me in the right direction, if not...

    I have a project where I want to use Spring (and Spring MVC), SiteMesh, and Velocity. This is actually an "AppFuse" project in case folks are familiar with that. I'm seeking input on the best way to configure things so that I can use the Spring Velocity macros (such as #springMessage) from within my decorator, as well as any other Velocity pages. Currently the problem I'm having has to do with only the files that go through the DispatcherServlet getting those macros and the request context exposed (which makes sense, but Matt/AppFuse suggested I check here to see if there's a way to expose them to all.

    Furthermore, I'm looking for any and all info related to Spring+SiteMesh+Velocity configurations (I'm also using Acegi security). I feel I have it partly working, and the Spring docs, as well as Raible's "Spring Live" book cover the configuration, but I have had some problems, so am just generally looking for any other samples or resources on the topic.

  2. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    Chris,

    You can configure macros for any Velocity runtime by putting the following line in your velocity.properties:

    velocimacro.library=myMacros.vm

    Where myMacros.vm is the path to the file containing the macros definitions.

    Rob

  3. #3

    Default

    Quote Originally Posted by robh
    Chris,

    You can configure macros for any Velocity runtime by putting the following line in your velocity.properties:

    velocimacro.library=myMacros.vm

    Where myMacros.vm is the path to the file containing the macros definitions.

    Rob
    So, sorry to be dense, but I assume this then implies that I need to configure Velocity externally in addition to doing it via Spring? Or, will setting this via Spring inject it in general into my Velocity configuration? I'm currently simply using the VelocityConfigurer with a resourceLoaderPath in my Spring bean definitions, I do not use a velocity.properties file. However, it appears from digging into this class (or rather VelocityEngineFactory) that I can set properties via a "velocityProperties" property in my bean definitions, and I could set "velocimacro.library" here? However, assuming I'm going for the spring.vm macro library, which is bundled up in spring.jar, will I need to extract that out?

  4. #4
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    Ben Alex wrote an excellent article on SiteMesh wiki that discuss SiteMesh Integration with Spring.
    HTH
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Sitemesh with Velocity Decorators
    By fsamir in forum Web
    Replies: 13
    Last Post: Oct 9th, 2005, 07:40 AM
  3. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  4. Replies: 2
    Last Post: Nov 25th, 2004, 03:41 PM
  5. Replies: 1
    Last Post: Nov 25th, 2004, 11:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •