Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 638 invoked by uid 500); 22 Mar 2002 16:51:28 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 627 invoked from network); 22 Mar 2002 16:51:28 -0000 Date: Fri, 22 Mar 2002 17:51:29 +0100 To: cocoon-dev@xml.apache.org Subject: Re: Adding values to Cocoon's context Message-ID: <20020322165129.GC12466@fztig938.bank.dresdner.net> References: <092C4B8A9B51D411829E00D0B749AFBBA831E5@post.flagship.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <092C4B8A9B51D411829E00D0B749AFBBA831E5@post.flagship.ru> User-Agent: Mutt/1.3.27i From: Marcus Crafter X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Fri, Mar 22, 2002 at 07:39:18PM +0300, Piroumian, Konstantin wrote: > I think that he meant the usual servlet context, not appContext from > CocoonServlet. You can add anything you need to your application context > using another servlet, then CocoonServlet will already have all the needed > data there on its load time. Ok. I understand. I thought he mean't the appContext. It's not really that elegant though, as it involves a 2 stage process to get values: public void contextualize(Context context) { o.a.c.e.Context ctx = (o.a.c.e.Context) context.get( Constants.CONTEXT_ENVIRONMENT_CONTEXT ); myvalue = (String) ctx.getAttribute(SOME_VALUE); } compared to: public void contextualize(Context context) { myvalue = (String) context.get(SOME_VALUE); } I like the 1-liner better, especially since this will be in application code. CocoonServlet.appContext has protected access, so someone have thought about sharing it to subclasses - shouldn't we make this work for all types of avalon components ? Or have I missed something again! :-) Cheers, Marcus -- ..... ,,$$$$$$$$$, Marcus Crafter ;$' '$$$$: Computer Systems Engineer $: $$$$: ManageSoft GmbH $ o_)$$$: 82-84 Mainzer Landstrasse ;$, _/\ &&:' 60327 Frankfurt Germany ' /( &&& \_&&&&' &&&&. &&&&&&&: --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org