Probably something like:
IRequestHandler handler =
Application.get().getRootRequestMapper().mapRequest(request);
if(handler instanceof IPageClassRequestHandler) {
return ((IPageClassRequestHandler)handler).getPageClass();
}
Martijn
On Tue, Feb 7, 2012 at 1:08 PM, Thomas Singer <[email protected]> wrote:
> Thank you for the hints. Our code should return the page class which is the
> mounted page for the specified path (QueryStringUrlCodingStrategy).
>
> Tom
>
>
> On 07.02.2012 12:17, Martijn Dashorst wrote:
>> The following commit shows:
>> https://github.com/apache/wicket/commit/b0fea8393d7f8f8db5d9e034a51d4578018d2fdf#diff-54
>>
>> that the RequestParameters were made obsolete.
>>
>> If you look at 1.5's Request class, you can see a IRequestParameter
>> interface. There are several implementations, and the Request class
>> provides several methods returning different IRequestParameters.
>>
>> AFAICT the RequestParameters have been superseded by different
>> IRequestParameter implementations, and depending on your use case, one
>> of those should be used.
>>
>> Looking at your code, probably you'd rather want to use a
>> RequestHandler or RequestMapper. It is not easy looking at the snippet
>> what the use case is you actually want to achieve.
>>
>> Martijn
>>
>> On Tue, Feb 7, 2012 at 11:39 AM, Thomas Singer <[email protected]> wrote:
>>> Following Wicket 1.4 code:
>>>
>>> final RequestParameters parameters = new RequestParameters();
>>> parameters.setParameters(new HashMap());
>>>
>>> String path = ...
>>> parameters.setPath(path);
>>> final IRequestTarget requestTarget = RequestCycle.get().getProcessor()
>>> .getRequestCodingStrategy().targetForRequest(parameters);
>>> if (!(requestTarget instanceof IBookmarkablePageRequestTarget)) {
>>> return null;
>>> }
>>>
>>> return ((IBookmarkablePageRequestTarget)requestTarget).getPageClass();
>>>
>>> does not compile in Wicket 1.5: RequestParameters is unknown,
>>> RequestCycle.get().getProcessor() is unknown, IBookmarkablePageRequestTarget
>>> is unknown, the migration guide is no help.
>>>
>>> Tom
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
--
Become a Wicket expert, learn from the best: http://wicketinaction.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]