views:

491

answers:

1

Hi!

I am trying to get request parameters on freemarker page. But I can't figure out how to setup implicit variables like RequestParameters or so.

Here is a thread http://forum.springsource.org/showthread.php?t=32846 but I don't where he setup that RequestParameters object.

The only thing I found in docs (more in source code), that it is FreemarkerServlet which can place that variable. But I don't have it in my application. All configurations are done via Spring, i.e. View Resolver.

Can anybody help me?

+1  A: 

Make sure that exposeRequestAttributes is enabled in your FreeMarkerViewResolver, e.g.

<bean id="viewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
      <property name="cache"  value="true" />
      <property name="prefix" value="" />
      <property name="suffix" value=".ftl" />
      <property name="requestContextAttribute"  value="request" />
      <property name="exposeSpringMacroHelpers" value="true" />
      <property name="exposeRequestAttributes"  value="true" />
      <property name="exposeSessionAttributes"  value="true" />

mx