Chances are your instanceof is failing because you put the SecurePage
interface into the pages or components package; move it up a level, to
a non-controlled package, so that the services layer and the component
layer can agree.  Anything inside the pages or components packages (or
mixins or base) will be loaded by a different class loader, and this
causes these apparently anomalous ClassCastExceptions.

But Thiago is right, Tapestry has a proper place for this kind of
thing, if you check my blog, you'll see an article where I head down
the same path as you (I've recently done this kind of thing for a
couple of different clients). I hope to have a simple authentication
framework, possibly as a Tapestry extension, at some point in the next
couple of months.


On Wed, Mar 31, 2010 at 12:31 PM, satb <satish...@yahoo.com> wrote:
>
>> Advice is for services, not pages and components.
>
> Thanks for the response.
>
> Yes. That is true. I want to do one other thing on the methods of the
> service if the request is originating from a "SecurePage" -- which is to
> check the credentials. Isn't advice the right thing for it? Thats what the
> above advice is trying to do except the "instaceof" check is always
> returning false.
>
> I guess what is causing some concern to me is -- why would "component
> instanceof SecurePage" return false?
> --
> View this message in context: 
> http://old.nabble.com/How-to-get-the-Component-inside-advice--tp28100055p28100745.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to