# is it possible to have default variable resolver and listener for a jar base?

dennis
3669 1 6
http://www.javaworld.com....

As so far as I know(or, maybe I just forgot)..variable resolver must be declared in zul's directive,
and listener is defined in zk.xml.

Is is possible to have some resolvers and listeners that defined in a jar file's metainfo,
then I only need to do is putting this jar into /lib, and zk will load it automatically (no need to write resolver on each page and zk.xml).

thanks~~cute guys.

/Dennis

delete retag edit

## 2 Replies

iantsai
2755 1

I can't find any layer to let you do this in Jar loading, you can post a Feature Request.(Tom said it would be easy~)

Maybe the simplest way is to extends UiFactory, override getPage() and insert your variable-resolver into new page.

But you still need to declare your new UiFactory in zk.xml.

iantsai
2755 1

metainfo/zk/config.xml doesn't accept ui-factory-class and many other setting. However, it accepts listener, thus you can specify

       <listener>
<listener-class>org.zkoss.zkmax.init.WebAppInit</listener-class>
</listener>

Then, in the WebAppInit implementation:

public void init(WebApp wapp) throws Exception {
wapp.getConfiguration().setUiFactoryClass(FooUiFactory.class);
}


[hide preview]