开发者

ZK - inject Spring beans directly into ZK beans

开发者 https://www.devze.com 2023-02-09 05:04 出处:网络
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开发者_如何学Go from web a

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开发者_如何学Go from web application complex, which very unelegant and unflexible.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消