Hello Peter,
It sounds like by 'filter' you mean a servlet filter and not a Tapestry
filter. Your requirements sound a tad exotic to me, but these wikis
should get you on the right track:
http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher
http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher2
They focus on implementing authentication/restriction code completely
outside of the 'page' level of the application. The focus on these is
the required infrastructure, so there are some holes left to be filled.
At any rate they should be useful for you. Note that the same thing can
be achieved using a Tapestry filter:
http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/services/RequestFilter.html
Sincerely,
Chris
Peter Stavrinides wrote:
Hi all
My question is more of a best practice related question, I want to use
a filter to extract my authentication code from the rest of the
application logic, so I can avoid adding this logic to pages. In
addition, one of my authentication requirements involves some
integration with third party applications so I need to check for
authentication headers... to accommodate this I use a session state
object in my app (i.e. a T5 service), which is available for the
duration of a users session.
Implementing an ordinary servlet filter would do the trick for the
authentication part... but then I wouldn't be able to use it with the
IoC service. So:
1. Is there a way to register my filter with Tapestry IoC instead of
registering it in web.xml? (would I create a contribution to the
framework?)
2. Can I inject this service (i.e. my state object )into the filter?
and what does this involve i.e. eager loading etc?
I am not sure I am going about this the right way, if someone has done
something similar could I get some pointers.
Thanks in advance,
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]