Announcement Announcement Module
Collapse
No announcement yet.
SpringMacros problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SpringMacros problem

    Hi All,
    m new to spring and using spring with velocity.
    My problem is that, I want to get the lables for my form fields from a resource file for which I had used following statement in my velocity file:

    #springMessage("fieldName.lable")

    accordingly i have made following entries in my xml file:

    <bean id="viewResolver" class="org.springframework.web.servlet.view.veloci ty.VelocityViewResolver">
    <property name="suffix"><value>.vm</value></property>
    <property name="exposeRequestAttributes">
    <value>true</value>
    </property>
    <property name="exposeSessionAttributes">
    <value>true</value>
    </property>
    <property name="exposeSpringMacroHelpers">
    <value>true</value>
    </property>
    </bean>

    and

    <bean id="messageSource" class="org.springframework.context.support.Resourc eBundleMessageSource">
    <property name="basename"><value>MyResources</value></property>
    </bean>

    where MyResources is a properties file in WEB-INF/Classes dir.

    now, the problem is that, when I run my velocity file following value appers on the browser:
    $springMacroRequestContext.getMessage($code)

    Here, I think the problem is that $springMacroRequestContext is not getting resolved. Please help. Its urgent.
    Thanx in advance
    Last edited by henry martin; Apr 17th, 2008, 12:22 AM.
Working...
X