OK.  As promised.  Here is the code that I believe is required to
support what you want.  Be aware that I have not actually used this nor
tested this, but did double check everything against eclipse as I went.

Two classes, and a contribution to the Ioc Module of your choosing.

Then whenever you return a PageRenderResult object, it will render that
page on the serverside and return it, without having the client-side do
a redirect.

Give it a shot if you want, and let us know how it goes.  You can add
this to the JIRA.



Fernando Padilla wrote:
> So the answer is: No Tapestry does not support that case out of the box
> yet.
> 
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html
> 
> You can see there how Tapestry handles different return types, and it
> doesn't list what you are talking about.  Myself, I like to call it
> server-side redirect; and it was Tapestry's default behavior before T5.
>  The new way is nice for various reasons, but in edge cases I do miss
> having the option of the old way.
> 
> First step is to create a JIRA issue to track what you want.
> 
> Second, someone will have to take the time to try to hack together a
> code solution.  Might actually be relatively easy, but I don't have the
> code in front of me right now.
> 
> 
> 
> Christian Gorbach wrote:
>> it's indeed a redirect. so it seems no real serverside page delegation is
>> possible without custom contributions.
>>
>>
>> Stephan Schwab wrote:
>>>
>>> Christian Gorbach wrote:
>>>> is it possible to implement a dispatcher/delegate page which is able to
>>>> forward to another known page class if business logic decides to do
>>>> so. It should be a pure server-side RequestDispatcher.forward and no
>>>> redirect.
>>>>
>>> You can return a page from the onActivate() method. But I think that
>>> will
>>> be a redirect.
>>>
>>> Stephan
>>> -- 
>>> http://www.stephan-schwab.com
>>>
>>>
>>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
public class AppModule {
        public void contributeComponentEventResultProcessor(
                        PageRenderResultProcessor handler,
                        MappedConfiguration<Class, 
ComponentEventResultProcessor> configuration)
        {
                configuration.add(PageRenderResult.class, new 
PageRenderResultProcessor( handler ));
        }
}



public class PageRenderResultProcessor implements 
ComponentEventResultProcessor<PageRenderResult>
{
        private PageRenderRequestHandler handler;
        public PageRenderResultProcessor( PageRenderRequestHandler handler )
        {
                this.handler = handler;
        }
    public ActionResponseGenerator processComponentEvent(final PageRenderResult 
pageRender,
            Component component, final String methodDescripion)
    {
        return handler.handle(pageRender.getPageName(), 
pageRender.getContext());
        }
}



public class PageRenderResult
{
        private String pageName;
        private Object[] context;
        public PageRenderResult(String pageName, Object[] context)
        {
                this.pageName = pageName;
                this.context = context;
        }
        public String getPageName()
        {
                return pageName;
        }
        public Object[] getContext()
        {
                return context;
        }
}

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

Reply via email to