Results 1 to 2 of 2

Thread: Velocity - RHS of #set statement is null

  1. #1

    Default Velocity - RHS of #set statement is null

    Hello,
    I'm using the spring velocity macros in a page and they were working when I was using the ResourceBundleViewResolver but I needed to switch to the UrlBasedViewResolver so I can use the 'forward:action.do' syntax to forward to new controllers but now I get the errors from velocity. I'm assuming this is because the springMacroRequestContext is not available, is that correct? Am I using the correct attribute, or is there another property I need to set?

    my view resolver config look like:
    Code:
    <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
        <property name="suffix">
          <value>.vm</value>
        </property>
        <property name="prefix">
          <value>/</value>
        </property>
        <property name="viewClass">
        <value>org.springframework.web.servlet.view.velocity.VelocityToolboxView</value>
        </property>
        <property name="attributes">
          <props>
            <prop key="exposeSpringMacroHelpers">true</prop>
          </props>
        </property>
      </bean>
    TIA
    Michael Fortin

  2. #2

    Default

    Just in case someone else came across the same problem, I figured it out on my own. The fallowing is the correct viewResolver to use:

    Code:
    <bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
        <property name="suffix">
          <value>.vm</value>
        </property>
        <property name="prefix">
          <value>/</value>
        </property>
        <property name="exposeSpringMacroHelpers">
          <value>true</value>
        </property>
        <property name="exposeRequestAttributes">
          <value>true</value>
        </property>
        <property name="exposeSessionAttributes">
          <value>true</value>
        </property>
      </bean>
    mike

Similar Threads

  1. Replies: 2
    Last Post: Oct 17th, 2005, 08:41 PM
  2. Replies: 4
    Last Post: Sep 27th, 2005, 11:31 PM
  3. Replies: 3
    Last Post: May 16th, 2005, 07:04 AM
  4. Strange Data Access Error
    By webifyit in forum Data
    Replies: 2
    Last Post: Dec 28th, 2004, 11:06 AM
  5. Replies: 8
    Last Post: Sep 23rd, 2004, 01:12 AM

Posting Permissions

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