:-)=)

Hi Howard,

thank you for pointing this out ;)

I did not expect this exception because I expect getService() to return a 
PageService - not a DirectService.

In my understanding (which seems to be wrong :) ) the DirectService was 
'consumed' on the Login-page to do the submit. 

After this, a callback is fired leading to the page where the exception occurs 
- so I expected to be in 'page mode' again :(

But actually this seems to be very wrong. 

What I need in this pageValidate is the absolute url of the PAGE with all its 
parameters, states and so on. My method was working fine - as long as there 
were only PageServices involved :(

Maybe someone could give me a hint how to obtain this complete page path 
without using getService() ?

Thanks again !

Gerald

>
>"Parameter parameter is of type java.lang.String which is not
>compatible with org.apache.tapestry.engine.DirectServiceParameter."
>
>The third parameter to the getLink() method (for the direct service)
>must be a DirectServiceParameter, not a string.  I'm not sure how
>Tapestry could phrase it any clearer.
>
>On 1/30/06, Gerald Schöffel <[EMAIL PROTECTED]> wrote:
>> Hi !
>>
>> While doing some research to solve this nasty https/http-switching problem I 
>have, I got to a point where a 'strange' exception is thrown.
>>
>> MyBasePage implements PageValidateListener:
>>
>> public void pageValidate(PageEvent event) {
>>
>>     String url = event.getRequestCycle().getService().getLink(true, 
>getPageName()).getAbsoluteURL() ;
>>
>>     ...
>> }
>>
>> All my pages extend MyBasePage.
>>
>> In my login page when submited, the following is executed:
>>
>> getCallback().performCallback(getRequestCycle()) ;
>>
>> where the callback is a PageCallback to the page I redirected from with
>>
>> throw new PageRedirectException(loginPage);
>>
>> When the callback is executed a java.lang.ClassCastException is thrown:
>>
>> Parameter parameter is of type java.lang.String which is not compatible with 
>org.apache.tapestry.engine.DirectServiceParameter.
>>
>> with the following stack trace:
>>
>> # org.apache.hivemind.util.Defense.isAssignable(Defense.java:56)
>> # org.apache.tapestry.engine.DirectService.getLink(DirectService.java:59)
>> # $IEngineService_1091ab1a158.getLink($IEngineService_1091ab1a158.java)
>> # 
>org.apache.tapestry.services.impl.EngineServiceOuterProxy.getLink(EngineService
>OuterProxy.java:61)
>> # mypackage.MyBasePage.pageValidate(MyBasePage.java:24)
>> # mypackage.MyTest.pageValidate(MyTest.java:42)
>>
>> where MyTest is the page I was redirecting from.
>>
>> Any ideas ?
>>
>> I am doing this pageValidate stuff to get the absolute URL as displayed in 
>the users browsers - maybe there is a better/easier/exceptionless way to do 
>this ?
>>
>--
>Howard M. Lewis Ship
>Independent J2EE / Open-Source Java Consultant
>Creator, Jakarta Tapestry
>Creator, Jakarta HiveMind
>
>Professional Tapestry training, mentoring, support
>and project work.  http://howardlewisship.com
>

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

Reply via email to