myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1702997 - /myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HttpPartWrapper.java
Date Mon, 14 Sep 2015 17:04:05 GMT
Author: lu4242
Date: Mon Sep 14 17:04:05 2015
New Revision: 1702997

URL: http://svn.apache.org/r1702997
Log:
MYFACES-4008 AbstractMethodError thrown by javax.servlet.http.Part.getSubmittedFileName()

Modified:
    myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HttpPartWrapper.java

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HttpPartWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HttpPartWrapper.java?rev=1702997&r1=1702996&r2=1702997&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HttpPartWrapper.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HttpPartWrapper.java
Mon Sep 14 17:04:05 2015
@@ -20,7 +20,10 @@ package org.apache.myfaces.shared.render
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.util.Collection;
+import javax.faces.FacesException;
 import javax.faces.FacesWrapper;
 import javax.faces.component.StateHolder;
 import javax.faces.context.FacesContext;
@@ -83,6 +86,36 @@ public class HttpPartWrapper implements
     {
         getWrapped().write(fileName);
     }
+    
+    public String getSubmittedFileName()
+    {
+        Part wrapped = getWrapped();
+        try
+        {
+            Method m = wrapped.getClass().getMethod("getSubmittedFileName");
+            return (String) m.invoke(wrapped);
+        }
+        catch (NoSuchMethodException ex)
+        {
+            throw new FacesException(ex);
+        }
+        catch (SecurityException ex)
+        {
+            throw new FacesException(ex);
+        } 
+        catch (IllegalAccessException ex)
+        {
+            throw new FacesException(ex);
+        } 
+        catch (IllegalArgumentException ex)
+        {
+            throw new FacesException(ex);
+        }
+        catch (InvocationTargetException ex)
+        {
+            throw new FacesException(ex);
+        }
+    }
 
     public Object saveState(FacesContext context)
     {



Mime
View raw message