savvas
Jul 25th, 2009, 07:15 AM
Hello,
I'm dealing with a strange VelocityConfigurer issue.
Using spring-mvc-2.5.6 I've configured the following set up:
<bean id="velocityConfigurer"
class="org.springframework.web.servlet.view.velocity.Velo cityConfigurer">
<property name="velocityEngine" ref="velocityEngineFactoryBean" />
</bean>
<bean id="velocityEngineFactoryBean" class="org.springframework.ui.velocity.VelocityEngineFact oryBean" >
<property name="resourceLoaderPath" value="file:/path_to_templates"/>
</bean>
<bean id="velocityResolver"
class="org.springframework.web.servlet.view.velocity.Velo cityViewResolver">
<property name="prefix" value=""/>
<property name="suffix" value=".vm"/>
<property name="exposeSpringMacroHelpers" value="true" />
<property name="exposeRequestAttributes" value="true" />
<property name="exposeSessionAttributes" value="true" />
</bean>
The problem is that that the macros defined in spring.vm files are not accessible.
My guess is that this file is not parsed at all because if I print :
$springMacroRequestContext.getContextPath()"/my_url" it works just fine which means that, as the documentation states, a springMacroRequestContext parameter is keyed in the model with the exposeSpringMacroHelpers property.
But when I print :
#springUrl('/my_url') I get #springUrl('/my_url')...
Any ideas?
thanks,
savvas
I'm dealing with a strange VelocityConfigurer issue.
Using spring-mvc-2.5.6 I've configured the following set up:
<bean id="velocityConfigurer"
class="org.springframework.web.servlet.view.velocity.Velo cityConfigurer">
<property name="velocityEngine" ref="velocityEngineFactoryBean" />
</bean>
<bean id="velocityEngineFactoryBean" class="org.springframework.ui.velocity.VelocityEngineFact oryBean" >
<property name="resourceLoaderPath" value="file:/path_to_templates"/>
</bean>
<bean id="velocityResolver"
class="org.springframework.web.servlet.view.velocity.Velo cityViewResolver">
<property name="prefix" value=""/>
<property name="suffix" value=".vm"/>
<property name="exposeSpringMacroHelpers" value="true" />
<property name="exposeRequestAttributes" value="true" />
<property name="exposeSessionAttributes" value="true" />
</bean>
The problem is that that the macros defined in spring.vm files are not accessible.
My guess is that this file is not parsed at all because if I print :
$springMacroRequestContext.getContextPath()"/my_url" it works just fine which means that, as the documentation states, a springMacroRequestContext parameter is keyed in the model with the exposeSpringMacroHelpers property.
But when I print :
#springUrl('/my_url') I get #springUrl('/my_url')...
Any ideas?
thanks,
savvas