Author: amarkhel
Date: 2010-01-06 13:09:40 -0500 (Wed, 06 Jan 2010)
New Revision: 16246
Added:
branches/community/3.3.X/framework/impl/src/main/java-jsf20/org/richfaces/JSF2Compatible.java
Modified:
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
Log:
Fix RFPL-296
Modified:
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
===================================================================
---
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2010-01-06
18:02:55 UTC (rev 16245)
+++
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2010-01-06
18:09:40 UTC (rev 16246)
@@ -25,9 +25,12 @@
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
import java.util.Iterator;
import java.util.Map;
+import javax.faces.FactoryFinder;
import javax.faces.application.ViewExpiredException;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@@ -40,6 +43,8 @@
import org.ajax4jsf.Messages;
import org.ajax4jsf.application.AjaxViewHandler;
+import org.ajax4jsf.component.AjaxRegionBrige;
+import org.ajax4jsf.component.UIDataAdaptor;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.context.ContextInitParameters;
import org.ajax4jsf.renderkit.AjaxContainerRenderer;
@@ -120,9 +125,32 @@
setNamespace((String) nz(config.getInitParameter(NAMESPACE_PARAMETER),
getNamespace()));
handleViewExpiredOnClient =
Boolean.parseBoolean(config.getServletContext().getInitParameter(ContextInitParameters.HANDLE_VIEW_EXPIRED_ON_CLIENT));
-
+ checkJSFVersion();
}
+ private void checkJSFVersion() {
+ boolean jsf2 = false;
+ try{
+ Object factory =
FactoryFinder.getFactory("javax.faces.context.PartialViewContextFactory");
+ jsf2 = true;
+ }catch(Exception e){
+ //It's normal situation
+ }
+ boolean jsf2compatible = false;
+ try {
+
Thread.currentThread().getContextClassLoader().loadClass("org.richfaces.JSF2Compatible");
+ jsf2compatible = true;
+ }catch (Throwable e) {
+ //It's normal situation
+ }
+ if(jsf2compatible && !jsf2){
+ log.warn("This version of RichFaces implementation compatible for JSF2.0, but
running under JSF1.2");
+ }
+ if(!jsf2compatible && jsf2){
+ log.warn("This version of RichFaces implementation compatible for JSF1.2, but
running under JSF2.0");
+ }
+ }
+
private Boolean stringToBoolean(String s) {
if ("false".equalsIgnoreCase(s)) {
return Boolean.FALSE;
Added:
branches/community/3.3.X/framework/impl/src/main/java-jsf20/org/richfaces/JSF2Compatible.java
===================================================================
---
branches/community/3.3.X/framework/impl/src/main/java-jsf20/org/richfaces/JSF2Compatible.java
(rev 0)
+++
branches/community/3.3.X/framework/impl/src/main/java-jsf20/org/richfaces/JSF2Compatible.java 2010-01-06
18:09:40 UTC (rev 16246)
@@ -0,0 +1,32 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+/**
+ * Vendor and version information for A4J project
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 15696 $ $Date: 2009-10-05 20:54:09 +0400 (Пн, 05 окт 2009) $
+ *
+ */
+public class JSF2Compatible {
+
+}
Show replies by date