You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Nathan Bubna <na...@esha.com> on 2002/07/10 17:41:11 UTC

Re: VELTOOLS - App scope items?

Nathan said:
> > I'm thinking a search order for
> > ChainedContext like:
> >
> > toolboxContext.get(key)
> > super.internalGet(key)
> > request/response/session/application
> > request attributes
> > session attributes
> > application attributes

ok, now i'm gonna argue with myself a bit. :-)
and i've brought this over to the dev list.  i didn't previously notice that
it was on the user one.  it belongs here.

upon further (and hopefully better) thought, the drawback to doing
super.internalGet(key) before just returning the req/res/sess/app is that a
template designer might unwittingly break some other part of the template
that requires the req/res/sess/app.  ick.  i don't think that's worth the
ability to block access to those objects per request.   but i'm still ok
with letting the tool developer screw things up, and i think being able to
override the exposed req/res/sess/app with the toolbox is far more useful.
so, here's my revised proposal/patch...

toolboxContext.get(key)
req/res/sess/app
super.internalGet(key)
request attributes
session attributes
application attributes

this way, the toolbox and req/res/sess/app are still both functionally
read-only to the templates. (their keys cannot be overridden by #set
statements in templates)

feedback?

Nathan Bubna
nathan@esha.com