Get page name inside Dispatcher

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Get page name inside Dispatcher

Nathan Quirynen
Hi,

I made an implementation of Dispatcher. I want to get the page name from
the request path. Is there any service I can use to achieve this?

I know in a ComponentRequestFilter for example I can use
PageRenderRequestParameters..getActivePageName(), but how can I do the
same inside a Dispatcher implementation?

Nathan


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Get page name inside Dispatcher

Thiago H. de Paula Figueiredo
On Fri, Nov 25, 2016 at 2:23 PM, Nathan Quirynen <
[hidden email]> wrote:

> Hi,
>

Hi!

I made an implementation of Dispatcher. I want to get the page name from
> the request path. Is there any service I can use to achieve this?
>
> I know in a ComponentRequestFilter for example I can use
> PageRenderRequestParameters..getActivePageName(), but how can I do the
> same inside a Dispatcher implementation?
>

Inject the ComponentEventLinkencoder service into your dispatcher and use
its decodePageRenderRequest(Request) method, which is exactly the same
Tapestry uses internally. It returns a PageRenderRequestParameters object,
which contains a getLogicalPageName() method which is exactly what you need.
Reply | Threaded
Open this post in threaded view
|

Re: Get page name inside Dispatcher

Nathan Quirynen
Indeed exactly what I need!
Thanks Thiago.

Nathan


On 25/11/16 19:02, Thiago H. de Paula Figueiredo wrote:

> On Fri, Nov 25, 2016 at 2:23 PM, Nathan Quirynen <
> [hidden email]> wrote:
>
>> Hi,
>>
> Hi!
>
> I made an implementation of Dispatcher. I want to get the page name from
>> the request path. Is there any service I can use to achieve this?
>>
>> I know in a ComponentRequestFilter for example I can use
>> PageRenderRequestParameters..getActivePageName(), but how can I do the
>> same inside a Dispatcher implementation?
>>
> Inject the ComponentEventLinkencoder service into your dispatcher and use
> its decodePageRenderRequest(Request) method, which is exactly the same
> Tapestry uses internally. It returns a PageRenderRequestParameters object,
> which contains a getLogicalPageName() method which is exactly what you need.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]