ZK - inject Spring beans directly into ZK beans

Is it possible to inject Spring beans directly into ZK backing beans?

In tutorials such as this I've found only an example, where application context was extracted manually from web application complex, which very unelegant and unflexible.

Answers


In fact, the VariableResolver is working, it is however hard to find, how to use it properly.

First, I had to include header in .zul file:

<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>

Then, use ${controllerBeanName} in apply attribute, f.e.

<window id="win" title="Typy mieszkaƄ" width="750px" border="normal"
      apply="${appartmentTypeController}">

In my case, appartmentTypeController is bean extending GeneralForwardComposer, defined in spring context.


did you try the Variable-Resolver ?? i found an article about it

http://books.zkoss.org/wiki/Small_Talks/2010/December/Integrate_ZK_Spreadsheet2.0.0_with_Spring


May ZK-DL http://zk.datalite.cz/zk-dl library help you? It takes it's own approach to Spring integration, not the original ZK way.


Need Your Help

Zip task in Ant - incuding empty and non-empty subdirectories

ant zip task

Alright, I've been going slightly insane with this one - what bugs me more is that I'm sure a few years back I'd done something similar to what I'm trying to do now.