• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Spring MVC 3 and velocity.properties

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to load Velocity with my Spring MVC framework.

I'm not sure how to configure it.

This is my velocity.properties in a nutshell:

resource.loader = file, url

##### File Resource Loader ###################################################
file.resource.loader.description = Velocity File Resource Loader
file.resource.loader.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = C:/Projects/Content/MAVERICK_MAIN/Maverick_Content/cms
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 0

##### URL Resource Loader ###################################################
url.resource.loader.class = org.apache.velocity.runtime.resource.loader.URLResourceLoader
url.resource.loader.root = http://dxande6.centurylink.com/cms
url.resource.loader.cache = false
url.resource.loader.modificationCheckInterval = 0

I've got this configured:

<bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
<property name="resourceLoaderPath" value="file://C:/Projects/Content/cms"/>;
</bean>

<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
<property name="configLocation" value="/WEB-INF/velocity/velocity.properties"/>
</bean>

<bean id="viewResolver"
class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
<property name="cache" value="true" />
<property name="prefix" value="" />
<property name="suffix" value=".vm" />

<!-- if you want to use the Spring Velocity macros, set this property to true -->
<property name="exposeSpringMacroHelpers" value="true" />
</bean>


I really want to use velocity.properties to drive the base location of my content as well as my velocity macros.
Any help on setting up the toolbox location would help as well.

Ultimately it would be nice to have these files located outside of the war.

Any suggestions on how to do this?

Thank you in advance!!!
 
Heroic work plunger man. Please allow me to introduce you to this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic