You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by to...@apache.org on 2006/02/16 16:28:30 UTC

svn commit: r378278 - in /myfaces: commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/ commons/trunk/src/main/java/org/apache/myfaces/util/ tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/

Author: tomsp
Date: Thu Feb 16 07:28:28 2006
New Revision: 378278

URL: http://svn.apache.org/viewcvs?rev=378278&view=rev
Log:
fixed class loading issue for WebSphere compatibility

Modified:
    myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/DefaultAddResource.java
    myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/MyFacesResourceLoader.java
    myfaces/commons/trunk/src/main/java/org/apache/myfaces/util/ClassUtils.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/GraphicImageDynamic.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/GraphicImageDynamicRenderer.java

Modified: myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/DefaultAddResource.java
URL: http://svn.apache.org/viewcvs/myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/DefaultAddResource.java?rev=378278&r1=378277&r2=378278&view=diff
==============================================================================
--- myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/DefaultAddResource.java (original)
+++ myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/DefaultAddResource.java Thu Feb 16 07:28:28 2006
@@ -22,6 +22,7 @@
 import org.apache.myfaces.renderkit.html.HTML;
 import org.apache.myfaces.renderkit.html.HtmlRendererUtils;
 import org.apache.myfaces.renderkit.html.HtmlResponseWriterImpl;
+import org.apache.myfaces.util.ClassUtils;
 
 import javax.faces.FacesException;
 import javax.faces.context.FacesContext;
@@ -30,7 +31,10 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.util.*;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * This is a utility class to render link to resources used by custom components.
@@ -494,7 +498,7 @@
 
     private Class getClass(String className) throws ClassNotFoundException
     {
-        Class clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
+        Class clazz = ClassUtils.classForName(className);
         validateResourceLoader(clazz);
         return clazz;
     }

Modified: myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/MyFacesResourceLoader.java
URL: http://svn.apache.org/viewcvs/myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/MyFacesResourceLoader.java?rev=378278&r1=378277&r2=378278&view=diff
==============================================================================
--- myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/MyFacesResourceLoader.java (original)
+++ myfaces/commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/MyFacesResourceLoader.java Thu Feb 16 07:28:28 2006
@@ -16,22 +16,22 @@
  */
 package org.apache.myfaces.renderkit.html.util;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.ResourceBundle;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.renderkit.html.HTML;
+import org.apache.myfaces.util.ClassUtils;
 
 import javax.servlet.ServletContext;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.ResourceBundle;
 
 /**
  * A ResourceLoader capable of fetching resources from the classpath,
@@ -216,7 +216,7 @@
 
     protected Class loadComponentClass(String componentClass) throws ClassNotFoundException
     {
-        return Thread.currentThread().getContextClassLoader().loadClass(componentClass);
+        return ClassUtils.classForName(componentClass);
     }
 
     // NOTE: This method is not being used. Perhaps it can be removed?

Modified: myfaces/commons/trunk/src/main/java/org/apache/myfaces/util/ClassUtils.java
URL: http://svn.apache.org/viewcvs/myfaces/commons/trunk/src/main/java/org/apache/myfaces/util/ClassUtils.java?rev=378278&r1=378277&r2=378278&view=diff
==============================================================================
--- myfaces/commons/trunk/src/main/java/org/apache/myfaces/util/ClassUtils.java (original)
+++ myfaces/commons/trunk/src/main/java/org/apache/myfaces/util/ClassUtils.java Thu Feb 16 07:28:28 2006
@@ -112,7 +112,7 @@
     //~ Methods ------------------------------------------------------------------------------------
 
     /**
-     * Tries a Class.forName with the context class loader of the current thread first and
+     * Tries a Class.loadClass with the context class loader of the current thread first and
      * automatically falls back to the ClassUtils class loader (i.e. the loader of the
      * myfaces.jar lib) if necessary.
      *

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/GraphicImageDynamic.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/GraphicImageDynamic.java?rev=378278&r1=378277&r2=378278&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/GraphicImageDynamic.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/GraphicImageDynamic.java Thu Feb 16 07:28:28 2006
@@ -16,6 +16,7 @@
 package org.apache.myfaces.custom.graphicimagedynamic;
 
 import org.apache.myfaces.component.html.ext.HtmlGraphicImage;
+import org.apache.myfaces.util.ClassUtils;
 
 import javax.faces.context.FacesContext;
 import javax.faces.el.EvaluationException;
@@ -95,8 +96,7 @@
             {
                 try
                 {
-                    clazz = Thread.currentThread().getContextClassLoader().loadClass(
-                            value.toString());
+                    clazz = ClassUtils.classForName(value.toString());
                 }
                 catch (ClassNotFoundException e)
                 {

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/GraphicImageDynamicRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/GraphicImageDynamicRenderer.java?rev=378278&r1=378277&r2=378278&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/GraphicImageDynamicRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/GraphicImageDynamicRenderer.java Thu Feb 16 07:28:28 2006
@@ -35,6 +35,7 @@
 import org.apache.myfaces.renderkit.html.HTML;
 import org.apache.myfaces.renderkit.html.HtmlRendererUtils;
 import org.apache.myfaces.renderkit.html.ext.HtmlImageRenderer;
+import org.apache.myfaces.util.ClassUtils;
 
 import javax.faces.FacesException;
 import javax.faces.FactoryFinder;
@@ -219,8 +220,7 @@
             }
             try
             {
-                Class rendererClass = Thread.currentThread().getContextClassLoader().loadClass(
-                        rendererValue.toString());
+                Class rendererClass = ClassUtils.classForName(rendererValue.toString());
                 if (!ImageRenderer.class.isAssignableFrom(rendererClass))
                 {
                     throw new FacesException("Image renderer class [" + rendererValue



Re: svn commit: r378278 - in /myfaces: commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/ commons/trunk/src/main/java/org/apache/myfaces/util/ tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/

Posted by Mario Ivankovits <ma...@ops.co.at>.
Oops, I wanted to send him per pm but forgot to change the mail address.
> Mario was saying...
>
> congrats!!
> you found it ...
>
> -Matthias
>
> On 2/16/06, Mario Ivankovits <ma...@ops.co.at> wrote:
>   
>> tomsp@apache.org schrieb:
>>     
>>> fixed class loading issue for WebSphere compatibility
>>>
>>>       
>> Gratulation!!
>> Habt ihr es doch noch gefunden.
>>
>> Ciao,
>> Mario
>>     


Re: svn commit: r378278 - in /myfaces: commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/ commons/trunk/src/main/java/org/apache/myfaces/util/ tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/

Posted by Matthias Wessendorf <mw...@gmail.com>.
Mario was saying...

congrats!!
you found it ...

-Matthias

On 2/16/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> tomsp@apache.org schrieb:
> > fixed class loading issue for WebSphere compatibility
> >
> Gratulation!!
> Habt ihr es doch noch gefunden.
>
> Ciao,
> Mario
>
>
>
>


--
Matthias Wessendorf
Zülpicher Wall 12, 239
50674 Köln
http://www.wessendorf.net
mwessendorf-at-gmail-dot-com

Re: svn commit: r378278 - in /myfaces: commons/trunk/src/main/java/org/apache/myfaces/renderkit/html/util/ commons/trunk/src/main/java/org/apache/myfaces/util/ tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/graphicimagedynamic/

Posted by Mario Ivankovits <ma...@ops.co.at>.
tomsp@apache.org schrieb:
> fixed class loading issue for WebSphere compatibility
>   
Gratulation!!
Habt ihr es doch noch gefunden.

Ciao,
Mario