You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniel Stoch <da...@gmail.com> on 2016/01/08 18:19:22 UTC

Invalid JS src url for ajax behaviors - degradation after 6.17.0

Hi,

I have upgraded Wicket from 6.17.0 to 6.21.0. And there is some
problem after this upgrade. I am using UrlPathPageParametersEncoder so
my page parameters are encoded like:
/param1Name/param1Value/param2Name/param2Value

Sample scenario to reproduce this problem:
1. User enters a bookmarkable page with four parameters, so url looks like:
http://localhost:8080/app/somepage/p1/v1/p2/v2/p3/v3/p4/v4
2. User clicks checkbox with AjaxFormChoiceComponentUpdatingBehavior
and the generated ajax response contains invalid (in 6.21.0) url to
JavaScript resources, eg.:

6.21.0
<script type="text/javascript"
src="../../../../wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1446158378000.js"></script>

but it shoud be:

6.17.0
<script type="text/javascript"
src="../../../../../../../../wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1409306560000.js"></script>


So there are only 4 "../" url parts in new Wicket version, instead of
8 in older one (6.17.0). This leads to invalid requests that come to
server (request contains invalid parameters in a path).

Are there any changes in 6.x branch after 6.17.0 version which can
cause such problems?

--
Best regards,
Daniel

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


Re: Invalid JS src url for ajax behaviors - degradation after 6.17.0

Posted by Daniel Stoch <da...@gmail.com>.
Hi,

Thanks for your answer.

I have tried to reproduce this problem in quickstart app and it seems
that it is a problem in my application.
Problem is related to Wicket-Ajax-BaseURL encoding, when parameter
values contains "#" (eg. abx#xyz). In 6.17.0 there were some problems
with these encodings and I have internal patch in overridden
MultipartServletWebRequestImpl.getHeader() method - I forgot to make
JIRA for that. It seems that in 6.21.0 these problems do not exist, so
my internal patch is not necessary, moreover generates an error which
I described in a previous email. So when I remove it, it seems that
everything works ok.

--
Best regards,
Daniel

On Fri, Jan 8, 2016 at 10:47 PM, Sven Meier <sv...@meiers.net> wrote:
> Hi,
>
> please create a quickstart and/or test case and attach it to a new Jira
> issue.
>
> This way we can dissect the problem.
>
> Best regards
> Sven
>
>
>
> On 08.01.2016 18:19, Daniel Stoch wrote:
>>
>> Hi,
>>
>> I have upgraded Wicket from 6.17.0 to 6.21.0. And there is some
>> problem after this upgrade. I am using UrlPathPageParametersEncoder so
>> my page parameters are encoded like:
>> /param1Name/param1Value/param2Name/param2Value
>>
>> Sample scenario to reproduce this problem:
>> 1. User enters a bookmarkable page with four parameters, so url looks
>> like:
>> http://localhost:8080/app/somepage/p1/v1/p2/v2/p3/v3/p4/v4
>> 2. User clicks checkbox with AjaxFormChoiceComponentUpdatingBehavior
>> and the generated ajax response contains invalid (in 6.21.0) url to
>> JavaScript resources, eg.:
>>
>> 6.21.0
>> <script type="text/javascript"
>>
>> src="../../../../wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1446158378000.js"></script>
>>
>> but it shoud be:
>>
>> 6.17.0
>> <script type="text/javascript"
>>
>> src="../../../../../../../../wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1409306560000.js"></script>
>>
>>
>> So there are only 4 "../" url parts in new Wicket version, instead of
>> 8 in older one (6.17.0). This leads to invalid requests that come to
>> server (request contains invalid parameters in a path).
>>
>> Are there any changes in 6.x branch after 6.17.0 version which can
>> cause such problems?
>>
>> --
>> Best regards,
>> Daniel
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

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


Re: Invalid JS src url for ajax behaviors - degradation after 6.17.0

Posted by Sven Meier <sv...@meiers.net>.
Hi,

please create a quickstart and/or test case and attach it to a new Jira 
issue.

This way we can dissect the problem.

Best regards
Sven


On 08.01.2016 18:19, Daniel Stoch wrote:
> Hi,
>
> I have upgraded Wicket from 6.17.0 to 6.21.0. And there is some
> problem after this upgrade. I am using UrlPathPageParametersEncoder so
> my page parameters are encoded like:
> /param1Name/param1Value/param2Name/param2Value
>
> Sample scenario to reproduce this problem:
> 1. User enters a bookmarkable page with four parameters, so url looks like:
> http://localhost:8080/app/somepage/p1/v1/p2/v2/p3/v3/p4/v4
> 2. User clicks checkbox with AjaxFormChoiceComponentUpdatingBehavior
> and the generated ajax response contains invalid (in 6.21.0) url to
> JavaScript resources, eg.:
>
> 6.21.0
> <script type="text/javascript"
> src="../../../../wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1446158378000.js"></script>
>
> but it shoud be:
>
> 6.17.0
> <script type="text/javascript"
> src="../../../../../../../../wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1409306560000.js"></script>
>
>
> So there are only 4 "../" url parts in new Wicket version, instead of
> 8 in older one (6.17.0). This leads to invalid requests that come to
> server (request contains invalid parameters in a path).
>
> Are there any changes in 6.x branch after 6.17.0 version which can
> cause such problems?
>
> --
> Best regards,
> Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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