Maybe such workaround (not very elegant though):
app.init():
getRequestCycleListeners().add(new PageRequestHandlerTracker());
private Page getCurrentPage(RequestCycle requestCycle) {
IPageRequestHandler pageRequestHandler =
PageRequestHandlerTracker.getLastHandler(requestCycle);
if ((pageRequestHandler != null) && (pageRequestHandler.getPage()
instanceof Page)) {
Page page = (Page)pageRequestHandler.getPage();
return page;
}
return null;
}
Page page = getCurrentPage(requestCycle.getPageParameters());
if (page != null) {
PageParameters pageParameters =
getCurrentPage(requestCycle.getPageParameters());
String value = pageParameters.getString(paramName);
} ...
?
--
Daniel
On Mon, Jan 19, 2015 at 3:38 PM, Daniel Stoch <[email protected]> wrote:
> Hi,
>
> In Wicket 1.4 I can get a page parameter value using this code:
>
> PageParameters pageParameters = requestCycle.getPageParameters();
> String value = pageParameters.getString(paramName);
>
>
> The problem is that in Wicket 6 there is no equivalent. I have tried
> with this solution:
>
> IRequestParameters requestParameters =
> requestCycle.getRequest().getRequestParameters();
> String value = requestParameters.getParameterValue(paramName).toString();
>
> but this does not work. These requestParameters does not contain
> parameters. I think the problem is related to url encoding strategy
> which is used. My urls are encoded like:
> somepath/param1/value1/param2/value2
>
> Is there another way to do this?
>
> --
> Best regards,
> Daniel
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]