struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-struts/src/share/org/apache/struts/util PropertyMessageResources.java
Date Sun, 21 Jul 2002 01:00:41 GMT
craigmcc    2002/07/20 18:00:40

  Modified:    .        STATUS
               src/share/org/apache/struts/util
                        PropertyMessageResources.java
  Log:
  Load property message resources via the thread context class loader, if it
  is available.
  
  PR: Bugzilla #10897
  Submitted by:	James Farley <jfarley at studentadvantage.com>
  
  Revision  Changes    Path
  1.35      +2 -3      jakarta-struts/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/STATUS,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- STATUS	20 Jul 2002 17:13:42 -0000	1.34
  +++ STATUS	21 Jul 2002 01:00:40 -0000	1.35
  @@ -6,7 +6,7 @@
               OUTSTANDING BUGS IN STRUTS 1.1-b1 AND NIGHTLY BUILDS
               ====================================================
   
  -                           18 open bugs to swat!!
  +                           17 open bugs to swat!!
   
   
   Controller:
  @@ -54,7 +54,6 @@
   
   Utilities:
   ---------
  -10897 PropertyMessageResources loading resources from the wrong ClassLoader
   
   
   Validator Framework:
  
  
  
  1.5       +10 -5     jakarta-struts/src/share/org/apache/struts/util/PropertyMessageResources.java
  
  Index: PropertyMessageResources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/PropertyMessageResources.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PropertyMessageResources.java	28 Jun 2002 01:08:39 -0000	1.4
  +++ PropertyMessageResources.java	21 Jul 2002 01:00:40 -0000	1.5
  @@ -287,7 +287,12 @@
               if (log.isTraceEnabled()) {
                   log.trace("  Loading resource '" + name + "'");
               }
  -            is = this.getClass().getClassLoader().getResourceAsStream(name);
  +            ClassLoader classLoader =
  +                Thread.currentThread().getContextClassLoader();
  +            if (classLoader == null) {
  +                classLoader = this.getClass().getClassLoader();
  +            }
  +            is = classLoader.getResourceAsStream(name);
               if (is != null) {
                   props.load(is);
                   is.close();
  
  
  

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>


Mime
View raw message