Results 1 to 1 of 1

Thread: SpringMacros problem

  1. #1

    Question 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 16th, 2008 at 11:22 PM.

Posting Permissions

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