-
FEATURED COMPONENTS
First time here? Check out the FAQ!
How can attributes on a SpringMVC Model object (e.g. ModelAndView) be resolved/accessed into variables from ZUL view?
No, it showns how to access Spring bean from the web application context.
I want to access the attributes from my Spring MVC model object, which is populated with data (as attributes) by my Spring MVC controllers.
If I use web application context, instead of the Spring MVC model then it degrades the purpose of the model which is reduced to do forwarding to views.
I think the Spring ModelAndView is attached to the request as a request attribute (sorry, couldn't find the attr name). I certainly have not tried it, but all of the request attributes are accessible from ZUL, though that would be a long lookup name.
You could also do something along the lines of the org.zkoss.zkplus.spring.DelegatingVariableResolver. You could:
public Object resolveVariable(String name) { Object value = null ; ... do other stuff to find variable first... Map map = Executions.getCurrent().getParameterMap() ; // get Spring MAV using correct map key value = mav.get( name ) ; return value ; }
Asked: 2010-07-09 04:16:27 +0800
Seen: 381 times
Last updated: Jul 09 '10