velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Yu" <e...@asgnet.psc.sc.edu>
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 [mailto:nathan@esha.com]
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
some
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
to
put the request/response/session/application at the end?   That would
allow
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:

toolboxContext.get(key)
super.internalGet(key)
request/response/session/application
request attributes
session attributes
application attributes

Nathan Bubna
nathan@esha.com


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


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


Mime
View raw message