You can do something "globally" to everything by plugging in to the
enhancement worker chain of services:

http://tapestry.apache.org/tapestry4.1/tapestry-framework/hivedoc/module/tapestry.enhance.html

To be honest though - I think the extending BasePage stuff was mostly
pre-annotations and may not necessarily be the most "ideal" way to do
it. (not that any on way is the best, it's all personal pref ) You
might also want to look at tapestry-acegi :

http://www.carmanconsulting.com/tapestry-acegi/

On 3/7/07, Chris Davies <[EMAIL PROTECTED]> wrote:
Dear fellow Tap-fans,

I'm looking to implement a very simple, re-usable security library for my
web applications.  The path I'm going down is one that seems to be common
(and embraced by Howard himself) - extending BasePage and implementing the
PageValidateListener to perform authorization checks within (call this the
BaseProtectedPage).

I'm a little bit stuck with a small detail though: part of my library design
is a service that should be accessible (and configurable) through the
HiveMind registry (e.g. a "PageProtectionService") which needs to be
injected into the BaseProtectedPage as part of the authorization mechanism.

Is there a clean way to inject this service into my BaseProtectedPage?
Ideally, I'd like to just be able to create a .page file corresponding to
BaseProtectedPage and specify service injections through that way, but as
far as I know, this doesn't work (as far as I'm aware, Tapestry only listens
to the page/component specification files of the lowest sub-class - doesn't
process any superclass page/component specs).  Thus the only alternative I
have is to resolve the service programmatically through the HiveMind
registry.  I don't mind doing this, but what's the cleanest way to access
the HiveMind registry held by Tapestry?  Do I have to create my own copy of
a Registry to be used within every instance of BaseProtectedPage?

Thanks for any help and guidance! =]

- Chris



--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to