velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sid...@apache.org
Subject cvs commit: jakarta-velocity-tools/view/src/java/org/apache/velocity/tools/view/context ChainedContext.java
Date Thu, 02 May 2002 12:09:08 GMT
sidler      02/05/02 05:09:08

  Modified:    view/src/java/org/apache/velocity/tools/view/context
                        ChainedContext.java
  Log:
  Fixed bug: If session was null, application scope attributes could not
  be accessed. (Thanks to Tom Dunstan for the report)
  
  Revision  Changes    Path
  1.6       +8 -5      jakarta-velocity-tools/view/src/java/org/apache/velocity/tools/view/context/ChainedContext.java
  
  Index: ChainedContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity-tools/view/src/java/org/apache/velocity/tools/view/context/ChainedContext.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ChainedContext.java	15 Apr 2002 18:30:29 -0000	1.5
  +++ ChainedContext.java	2 May 2002 12:09:08 -0000	1.6
  @@ -99,7 +99,7 @@
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
    * @author <a href="mailto:sidler@teamup.com">Gabe Sidler</a>
    *
  - * @version $Id: ChainedContext.java,v 1.5 2002/04/15 18:30:29 sidler Exp $ 
  + * @version $Id: ChainedContext.java,v 1.6 2002/05/02 12:09:08 sidler Exp $ 
    */
   public class ChainedContext extends VelocityContext implements ViewContext
   {
  @@ -229,17 +229,20 @@
           {
               o = request.getAttribute( key );
   
  -            if ( o == null && session != null )
  +            if ( o == null )
               {
  -                o = session.getAttribute( key );
  -                
  +                if ( session != null )
  +                {
  +                    o = session.getAttribute( key );
  +                }
  +
                   if ( o == null )
                   {
                       o = application.getAttribute( key );
                   }
               }
           }
  -        
  +
           return o;
       }
   
  
  
  

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


Mime
View raw message