"requestCycle.getRequest().getUrl() return null for me." - sorry, not
null but returns only a mount path without paramname/paramvalue part.

On Mon, Jan 19, 2015 at 5:09 PM, Daniel Stoch <daniel.st...@gmail.com> wrote:
> On Mon, Jan 19, 2015 at 4:54 PM, Martin Grigorov <mgrigo...@apache.org> wrote:
>> Hi,
>>
>> On Mon, Jan 19, 2015 at 4:38 PM, Daniel Stoch <daniel.st...@gmail.com>
>> 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();
>>>
>>
>> request.getQueryParameters() is the equivalent, but #getRequestParameters()
>> would work too because it is a mix of GET and POST parameters
>
> But I think it does not work with UrlPathPageParametersEncoder.
>
>>
>>
>>>
>>> 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
>>>
>>
>> Check org.apache.wicket.request.mapper.parameter.UrlPathPageParametersEncoder
>
> Ok, but how should I get url argument?
> requestCycle.getRequest().getUrl() return null for me.
>
> Another, minor, problem is that with this solution I have a hard coded
> page parameters encoder here. In previous version the code can be
> universal: it does not matter which encoding strategies page is using.
> For now if there will be pages with different encoding strategies this
> code stops working.
>
> --
> Daniel
>
>
>
>>
>>
>>>
>>> Is there another way to do this?
>>>
>>> --
>>> Best regards,
>>> Daniel
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to