velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Yu" <>
Subject RE: VELTOOLS - App scope items?
Date Wed, 10 Jul 2002 14:31:24 GMT
Sometime, it is neccessary to expose important objects such as request,
session and application to write useful macros. Is there a way to fend
off access to these object before a macro invocation?

-----Original Message-----
From: Nathan Bubna []
Sent: Wednesday, July 10, 2002 10:24 AM
To: Velocity Users List
Subject: Re: VELTOOLS - App scope items?

Tim said:
> How would I disallow an HTML designer from invoking any public method
> they please on that $application variable? (ex.
> $application.removeAttribute("it_would_be_bad_to_remove_me")

uh... don't tell them that $application is there? :-)

ok, actually, this is good question.  i'm sure it would be best to have
sort of configurable ChainedContext or make the ViewContext used by VVS
pluggable (with some prepackaged options perhaps).
but, as an easier and more immediate solution, would it be enough if we
changed the search order in ChainedContext's internalGet(String) method
put the request/response/session/application at the end?   That would
you to override the key "application" with an application-scope ViewTool
that wraps the ServletContext and only exposes the methods you feel
comfortable giving to the designer.   I'm thinking a search order for
ChainedContext like:

request attributes
session attributes
application attributes

Nathan Bubna

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message