From 83d1f94d6f01d7beb395e0b777868c216e6dc597 Mon Sep 17 00:00:00 2001 From: hieplq Date: Fri, 23 Oct 2015 23:04:31 +0700 Subject: [PATCH] IDEMPIERE-2907:update library (zk, c3p0) fix bad thing report at http://forum.zkoss.org/question/98875/problems-with-freshly-ce-version-707/?answer=99185#post-id-99185 http://forum.zkoss.org/question/99181/ce-freshly-707-requires-zk-pe-or-ee/ --- .../zkoss/zk/ui/sys/WebAppFactoryExImpl.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 org.adempiere.ui.zk/WEB-INF/src/org/zkoss/zk/ui/sys/WebAppFactoryExImpl.java diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/zkoss/zk/ui/sys/WebAppFactoryExImpl.java b/org.adempiere.ui.zk/WEB-INF/src/org/zkoss/zk/ui/sys/WebAppFactoryExImpl.java new file mode 100644 index 0000000000..40eadea2a0 --- /dev/null +++ b/org.adempiere.ui.zk/WEB-INF/src/org/zkoss/zk/ui/sys/WebAppFactoryExImpl.java @@ -0,0 +1,39 @@ +/****************************************************************************** + * Copyright (C) 2014 iDempiere * + * Product: iDempiere ERP & CRM Smart Business Solution * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ + +package org.zkoss.zk.ui.sys; + +import org.zkoss.zk.ui.UiException; +import org.zkoss.zk.ui.WebApp; +import org.zkoss.zk.ui.http.SimpleWebApp; +import org.zkoss.zk.ui.util.Configuration; + +public class WebAppFactoryExImpl implements WebAppFactory { + + @Override + public WebApp newWebApp(Object ctx, Configuration config) { + Class cls = config.getWebAppClass(); + if (cls != null) { + try { + return (WebApp)cls.newInstance(); + } catch (Exception ex) { + throw UiException.Aide.wrap(ex, "Unable to construct "+cls); + } + } else { + return new SimpleWebApp(); + } + + } + +} \ No newline at end of file