answered
2014-02-13 07:10:43 +0800
cor3000 6280 ● 2 ● 7 Hi Chill,
you can use several config files for each environment and just define a different environment variable.
e.g.
-Dorg.zkoss.zk.config.path=/WEB-INF/config/zk-testing.xml
or define it on at the command line to keep the jboss startup scripts unchanged
SET org.zkoss.zk.config.path=/WEB-INF/config/zk-testing.xml
If that is still not an option:
You can set/replace the IdGenerator on the WebApp after it has been initialized.
Use the WebAppInit listener to change the zk application config after initialization of the webapp. You can set an IdGenerator implementation, depending on on the environment (determined by e.g. hostname/ip address/system propery ...).
e.g.
init(WebApp wapp) {
//define your environment
WebAppCtrl appCtrl = (WebAppCtrl)wapp;
appCtrl.setIdGenerator(yourIdGenerator)
}
BTW: there is no IdGenerator implementation for the Default generation strategy. It is coded into the DesktopImpl class (getNextUuid(...)).
Robert