Hi there,
I'm new to Spring and Velocity and having a config issue - I think that I may be missing some part of the configuration. If I do a manual merge of a template and a velocity context, everything works fine. But when I try to do this in a web app with a view resolver, its like the spring is ignoring the model, and it will show an error like:
"WARN - CommonsLoggingLogSystem.logVelocityMessage(45) | org.apache.velocity.runt
ime.exception.ReferenceException: reference : template = login.vm [line 6,column 1] : ${loginError} is not a valid reference."
Here is a snippet from my controller:
public ModelAndView gotoLoginPage(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
logger.info("gotoLoginPage request");
ModelAndView mv;
Map<Object, Object> model = new HashMap<Object, Object>();
model.put("loginError", "false");
mv = new ModelAndView("login", "model", model);
return mv;
}
Here is my servlet config file snippet:
<bean id="velocityConfig"
class="org.springframework.web.servlet.view.veloci ty.VelocityConfigurer">
<property name="resourceLoaderPath"><value>/WEB-INF/velocity/</value></property>
</bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.veloci ty.VelocityViewResolver">
<property name="cache"><value>false</value></property>
<property name="prefix"><value></value></property>
<property name="suffix"><value>.vm</value></property>
</bean>
Any hints/suggestions MUCH appreciated!
Javatar


Reply With Quote
