Spring MVC with Freemarker
I'm using Spring MVC 3 with Freemarker views and I'm facing this strange
problem:
When I first request a page my autowired service layer loads a list of
objects and I can display them on the view correctly
In the follwing requests (refreshing the page) I can see the correct
number of elements in the list, but the properties of the objects in the
list have all null values
My Freemarker configuration:
<bean id="viewResolver"
class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property name="cache" value="false" />
<property name="prefix" value="" />
<property name="suffix" value=".ftl" />
<property name="requestContextAttribute" value="rc" />
</bean>
My controller method (contextData is autowired):
@RequestMapping({ "/", "/list" })
public void list(@ModelAttribute("model") ModelMap model) {
model.addAttribute("contentFTL", "../teams/teamList.ftl");
model.addAttribute("allTeams",
teamService.allByTenant(contextData.getTenantKey()));
}
Any idea of what to check?
No comments:
Post a Comment