myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r642686 - in /myfaces/tomahawk/trunk/sandbox/core: pom.xml src/main/java/org/apache/myfaces/custom/ppr/PPRFacesContextWrapper.java
Date Sun, 30 Mar 2008 05:26:17 GMT
Author: imario
Date: Sat Mar 29 22:26:16 2008
New Revision: 642686

URL: http://svn.apache.org/viewvc?rev=642686&view=rev
Log:
use Orchestras hack to make FacesContextWraper work in JSF 1.2 too

Modified:
    myfaces/tomahawk/trunk/sandbox/core/pom.xml
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRFacesContextWrapper.java

Modified: myfaces/tomahawk/trunk/sandbox/core/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/pom.xml?rev=642686&r1=642685&r2=642686&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/pom.xml (original)
+++ myfaces/tomahawk/trunk/sandbox/core/pom.xml Sat Mar 29 22:26:16 2008
@@ -20,6 +20,14 @@
         <url>http://svn.apache.org/viewcvs.cgi/myfaces/tomahawk/trunk/sandbox/core</url>
     </scm>
 
+    <repositories>
+        <repository>
+          <id>java-net</id>
+          <url>http://download.java.net/maven/1</url>
+          <layout>legacy</layout>
+        </repository>
+    </repositories>
+    
     <dependencies>
   
         <!-- compile -->
@@ -108,7 +116,15 @@
             <version>2.3</version>
             <scope>provided</scope>
         </dependency>
-        
+
+        <dependency>
+          <!-- Needed for JSF1.2 compatibility hacks -->
+          <groupId>javax.el</groupId>
+          <artifactId>el-api</artifactId>
+          <version>1.0</version>
+          <scope>provided</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.freemarker</groupId>
             <artifactId>freemarker</artifactId>

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRFacesContextWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRFacesContextWrapper.java?rev=642686&r1=642685&r2=642686&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRFacesContextWrapper.java
(original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/ppr/PPRFacesContextWrapper.java
Sat Mar 29 22:26:16 2008
@@ -18,6 +18,7 @@
 */
 package org.apache.myfaces.custom.ppr;
 
+import javax.el.ELContext;
 import javax.faces.application.Application;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIViewRoot;
@@ -26,6 +27,8 @@
 import javax.faces.context.ResponseStream;
 import javax.faces.context.ResponseWriter;
 import javax.faces.render.RenderKit;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.util.Iterator;
 
 /**
@@ -41,7 +44,7 @@
     //~ Instance fields -------------------------------------------------------
 
     private final FacesContext _facesContext;
-    // private Method methodGetELContext = null;
+    private Method methodGetELContext = null;
 
     public PPRFacesContextWrapper(FacesContext facesContext)
     {
@@ -175,7 +178,6 @@
      * actually referenced, so in some cases (including Sun Java 1.4-1.6) the
      * el library *can* be omitted from the classpath with JSF1.1.
      */
-    /*
     public final ELContext getELContext()
     {
     	// Here, we cannot call getELContext on FacesContext as it does not
@@ -194,24 +196,17 @@
     	catch(NoSuchMethodException e)
     	{
     		// should never happen
-    		Log log = LogFactory.getLog(this.getClass());
-    		log.error("JSF1.2 method invoked in non-JSF-1.2 environment", e);
-    		throw new IllegalStateException("JSF1.2 method invoked in non-JSF-1.2 environment");
+    		throw (IllegalStateException) new IllegalStateException("JSF1.2 method invoked in non-JSF-1.2
environment").initCause(e);
     	}
     	catch(InvocationTargetException e)
     	{
     		// should never happen
-    		Log log = LogFactory.getLog(this.getClass());
-    		log.error("Method getELContext on wrapped instance threw exception", e);
-    		throw new IllegalStateException("Method getELContext on wrapped instance threw exception");
+    		throw (IllegalStateException) new IllegalStateException("Method getELContext on wrapped
instance threw exception").initCause(e);
     	}
     	catch(IllegalAccessException e)
     	{
     		// should never happen
-    		Log log = LogFactory.getLog(this.getClass());
-    		log.error("Method getElContext on wrapped instance is not accessable", e);
-    		throw new IllegalStateException("Method getElContext on wrapped instance is not accessable");
+    		throw (IllegalStateException) new IllegalStateException("Method getElContext on wrapped
instance is not accessable").initCause(e);
     	}
     }
-    */
 }



Mime
View raw message