-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello Forum,
I'm using Spring MVC with ZK and I create a Spring MVC ModelAndView in a controller and populate it with data for the view.
But I can't find any way to access/resolve the ModelAndView in a my views which are implemented as ZUL files.
I use the both the
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
in my views, but they seem to resolve my variable names to beans in my web application context?!
So:
1) How can I resolve variables in a ZUL views to the content of a Spring MVC model, i.e. an ModelAndView object?
2) How of the two resolvers gives me access to @{xzy} notation when accessing Spring beans?
I think currently Spring MVC ModelAndView is still a page based technology, I'm not sure the way you integrate this two.
Can you show me your Spring MVC config xml and how you bind it to the ZK Component(The annotation declaration)?
I haven't looked at the specific Spring Controller code in awhile, but I think it puts the ModelAndView as a request attribute. If so, you could create your own DelegatingVariableResolver and have it look for the bean in the request first and then in the Spring WebApplicationContext if it doesn't find it. The class org.zkoss.zkplus.databind.AnnotateDataBinderInit is very small and could be cloned and customized easily.
Asked: 2010-07-09 02:14:54 +0800
Seen: 1,069 times
Last updated: Jul 11 '10