Hum ... your advice seemed quite straighforward ....

By some reason I can't cast to the interface either ...

Weirdo ...

I have rebuild the project and restarted the APP since i thought that the
old Login.class could spoke me ...

java.lang.ClassCastException com.tellpoker.pages.Login cannot be cast to
com.tellpoker.pages.ILogin

Stack trace

   - 
com.tellpoker.services.ProtectedPageGateKeeper.checkAccess(ProtectedPageGateKeeper.java:147)

   - 
com.tellpoker.services.ProtectedPageGateKeeper.dispatch(ProtectedPageGateKeeper.java:64)

   - $Dispatcher_124a0b9d291.dispatch($Dispatcher_124a0b9d291.java)
   - $Dispatcher_124a0b9d286.dispatch($Dispatcher_124a0b9d286.java)
   - 
org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:245)

   - com.tellpoker.services.AppModule$1.service(AppModule.java:144)
   - $RequestFilter_124a0b9d285.service($RequestFilter_124a0b9d285.java)
   - $RequestHandler_124a0b9d287.service($RequestHandler_124a0b9d287.java)
   - 
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)

   - $RequestHandler_124a0b9d287.service($RequestHandler_124a0b9d287.java)
   - 
org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778)

   - $RequestHandler_124a0b9d287.service($RequestHandler_124a0b9d287.java)
   - 
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767)

   - $RequestHandler_124a0b9d287.service($RequestHandler_124a0b9d287.java)
   - 
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85)

   - $RequestHandler_124a0b9d287.service($RequestHandler_124a0b9d287.java)
   - 
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90)

   - 
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81)

   - 
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)

   - 
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103)

   - $RequestHandler_124a0b9d287.service($RequestHandler_124a0b9d287.java)
   - $RequestHandler_124a0b9d27c.service($RequestHandler_124a0b9d27c.java)
   - 
org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:197)

   - org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)

   - 
$HttpServletRequestHandler_124a0b9d27e.service($HttpServletRequestHandler_124a0b9d27e.java)

   - 
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)

   - 
$HttpServletRequestFilter_124a0b9d27b.service($HttpServletRequestFilter_124a0b9d27b.java)

   - 
$HttpServletRequestHandler_124a0b9d27e.service($HttpServletRequestHandler_124a0b9d27e.java)

   - 
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:726)

   - 
$HttpServletRequestHandler_124a0b9d27e.service($HttpServletRequestHandler_124a0b9d27e.java)

   - 
$HttpServletRequestHandler_124a0b9d279.service($HttpServletRequestHandler_124a0b9d279.java)

   - org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)

2009/10/29 Gunnar Eketrapp <gunnar.eketr...@gmail.com>

> Thanks a lot !!!
>
> 2009/10/29 Ulrich Stärk <u...@spielviel.de>
>
> Have your page implement an interface that provides methods for setting the
>> desired information and cast the result from componentSource.getPage() to
>> that interface.
>> The reason behind this is that the thing returned from componentSource is
>> a bytecode-enhanced version of your Login page and thus cannot be cast to
>> your Login class type directly.
>>
>> Uli
>>
>> Am 29.10.2009 15:09 schrieb Gunnar Eketrapp:
>>
>>  Hi!
>>>
>>> I just switched from my own brewed secured page implementation that was
>>> based on checking access rights in onActivate()
>>> to the smarter more transparent solution outlined in Jumpstart app.
>>>
>>> I.e. ProtectedPage annotation + ProtecetdPageGateKeeper dispatcher.
>>>
>>> It works like a charm except for the fact that I have trouble informing
>>> the
>>> Login page about the failed page so that it can continue on to it
>>> after a successful login. My dumb solution managed this ....
>>>
>>> The problem I am having is that I dont know how to get hold of the Login
>>> page from within the ProtectedPageGateKeeper dispatcher.
>>>
>>>                // Setup Login page to redirect to the secured page after
>>> the login
>>>                Login login = (Login)
>>> componentSource.getPage(Login.class);
>>>                login.setRedirectTo(page);
>>> This fails with ...
>>>
>>>                  [ERROR] TapestryModule.RequestExceptionHandler
>>> Processing
>>> of request failed with uncaught exception:
>>>                  com.tellpoker.pages.Login cannot be cast to
>>> com.tellpoker.pages.Login
>>>                  java.lang.ClassCastException: com.tellpoker.pages.Login
>>> cannot be cast to com.tellpoker.pages.Login
>>>
>>> I have also tried @InjectPage but got null instead of a page.
>>>
>>> Thanks in advance,
>>> Gunnar Eketrapp
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo

Reply via email to