You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Gabriel Sidler <si...@teamup.ch> on 2002/05/02 14:12:02 UTC

Re: [PATCH] ChainedContext application vars not visible when session null

Tom Dunstan wrote:

> Hi folks
> 
> I think I've found a bug in the ChainedContext class in the tools/view
> sub-project.
> 
> If a user's session is null, the application attributes don't appear in
> the context.
> 
> Here's a patch to fix it.


Good catch! Thanks a lot for the report. I just commited the fix to
the repository.

> Sorry if this went to the wrong place, I couldn't see a tools specific
> dev list.


This is the right place! :-)


Gabe




> 
> Cheers
> 
> Tom
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Index: view/src/java/org/apache/velocity/tools/view/context/ChainedContext.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-velocity-tools/view/src/java/org/apache/velocity/tools/view/context/ChainedContext.java,v
> retrieving revision 1.5
> diff -u -r1.5 ChainedContext.java
> --- view/src/java/org/apache/velocity/tools/view/context/ChainedContext.java	15 Apr 2002 18:30:29 -0000	1.5
> +++ view/src/java/org/apache/velocity/tools/view/context/ChainedContext.java	30 Apr 2002 06:44:28 -0000
> @@ -232,11 +232,11 @@
>              if ( o == null && session != null )
>              {
>                  o = session.getAttribute( key );
> -                
> -                if ( o == null )
> -                {
> -                    o = application.getAttribute( key );
> -                }
> +            }
> +
> +            if ( o == null )
> +            {
> +                o = application.getAttribute( key );
>              }
>          }
>          
> 
> 
> 
> ------------------------------------------------------------------------
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


-- 
--
Gabriel Sidler
Software Engineer, Eivycom GmbH, Zurich, Switzerland


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>