You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thijs <vo...@gmail.com> on 2011/03/11 12:08:42 UTC

problem using pre & post ajax handlers

Hi,

I have the following issue.
I have a separate js that on window.onload calls:
Wicket.Ajax.registerPreCallHandler(foo);
Wicket.Ajax.registerPostCallHandler(bar);
Wicket.Ajax.registerFailureHandler(bar);
This works great however not on the first page load when there is no 
session yet.

The session starts on the page visited so every resource gets 
;sessionid=xyz appended
http://localhost:8080/xyz/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=48703E4E37189E284112EA7A8CD6F8DB?w:lm=1299841674
Then on the first ajax-call it re-downloads all resources (including 
wicket-event.js and wicket-ajax.js) but this time without the ;sessionid 
appended. This seems to cause the registration of the pre and post 
handlers to be forgotten. And they are never called again.

So I have 2 questions.
1. How can I prevent the resources from being downloaded twice (which 
would prevent the issue from happening in the first place).
2. If 1. can't be done. How can I re-register the pre and post handlers? 
So that subsequent ajax calls keep calling my Javascript in there pre 
and post calls?

thanks

Thijs


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


Re: problem using pre & post ajax handlers

Posted by Thijs <vo...@gmail.com>.
Looks like I found it.

Turns out that somewhere between 1.4.10 and 1.4.16 something changed and 
jsessionid's get stripped from resources.
I'll do some further testing but it seems to work ok now.

Thanks
Thijs


On 11-3-2011 16:18, Pedro Santos wrote:
> you can disable the browser cookies, than the sessionid will show up
>
> On Fri, Mar 11, 2011 at 11:19 AM, Thijs<vo...@gmail.com>  wrote:
>
>> I've been trying to create a quickstart displaying the problem all
>> afternoon. But I can't seem to get it to generate resources links with
>> ;sessionid's in them.
>> While in my own application, when I do session.get().bind() on a stripped
>> down page it does. So I'll be trying to get this to show up first...
>>
>> Thijs
>>
>>
>> On 11-3-2011 12:33, Pedro Santos wrote:
>>
>>> looks like a bug, open a ticket + quickstart please
>>>
>>> On Fri, Mar 11, 2011 at 8:08 AM, Thijs<vo...@gmail.com>   wrote:
>>>
>>>   Hi,
>>>> I have the following issue.
>>>> I have a separate js that on window.onload calls:
>>>> Wicket.Ajax.registerPreCallHandler(foo);
>>>> Wicket.Ajax.registerPostCallHandler(bar);
>>>> Wicket.Ajax.registerFailureHandler(bar);
>>>> This works great however not on the first page load when there is no
>>>> session yet.
>>>>
>>>> The session starts on the page visited so every resource gets
>>>> ;sessionid=xyz appended
>>>>
>>>>
>>>> http://localhost:8080/xyz/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=48703E4E37189E284112EA7A8CD6F8DB?w:lm=1299841674
>>>> Then on the first ajax-call it re-downloads all resources (including
>>>> wicket-event.js and wicket-ajax.js) but this time without the ;sessionid
>>>> appended. This seems to cause the registration of the pre and post
>>>> handlers
>>>> to be forgotten. And they are never called again.
>>>>
>>>> So I have 2 questions.
>>>> 1. How can I prevent the resources from being downloaded twice (which
>>>> would
>>>> prevent the issue from happening in the first place).
>>>> 2. If 1. can't be done. How can I re-register the pre and post handlers?
>>>> So
>>>> that subsequent ajax calls keep calling my Javascript in there pre and
>>>> post
>>>> calls?
>>>>
>>>> thanks
>>>>
>>>> Thijs
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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: problem using pre & post ajax handlers

Posted by Pedro Santos <pe...@gmail.com>.
you can disable the browser cookies, than the sessionid will show up

On Fri, Mar 11, 2011 at 11:19 AM, Thijs <vo...@gmail.com> wrote:

> I've been trying to create a quickstart displaying the problem all
> afternoon. But I can't seem to get it to generate resources links with
> ;sessionid's in them.
> While in my own application, when I do session.get().bind() on a stripped
> down page it does. So I'll be trying to get this to show up first...
>
> Thijs
>
>
> On 11-3-2011 12:33, Pedro Santos wrote:
>
>> looks like a bug, open a ticket + quickstart please
>>
>> On Fri, Mar 11, 2011 at 8:08 AM, Thijs<vo...@gmail.com>  wrote:
>>
>>  Hi,
>>>
>>> I have the following issue.
>>> I have a separate js that on window.onload calls:
>>> Wicket.Ajax.registerPreCallHandler(foo);
>>> Wicket.Ajax.registerPostCallHandler(bar);
>>> Wicket.Ajax.registerFailureHandler(bar);
>>> This works great however not on the first page load when there is no
>>> session yet.
>>>
>>> The session starts on the page visited so every resource gets
>>> ;sessionid=xyz appended
>>>
>>>
>>> http://localhost:8080/xyz/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=48703E4E37189E284112EA7A8CD6F8DB?w:lm=1299841674
>>> Then on the first ajax-call it re-downloads all resources (including
>>> wicket-event.js and wicket-ajax.js) but this time without the ;sessionid
>>> appended. This seems to cause the registration of the pre and post
>>> handlers
>>> to be forgotten. And they are never called again.
>>>
>>> So I have 2 questions.
>>> 1. How can I prevent the resources from being downloaded twice (which
>>> would
>>> prevent the issue from happening in the first place).
>>> 2. If 1. can't be done. How can I re-register the pre and post handlers?
>>> So
>>> that subsequent ajax calls keep calling my Javascript in there pre and
>>> post
>>> calls?
>>>
>>> thanks
>>>
>>> Thijs
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>


-- 
Pedro Henrique Oliveira dos Santos

Re: problem using pre & post ajax handlers

Posted by Thijs <vo...@gmail.com>.
I've been trying to create a quickstart displaying the problem all 
afternoon. But I can't seem to get it to generate resources links with 
;sessionid's in them.
While in my own application, when I do session.get().bind() on a 
stripped down page it does. So I'll be trying to get this to show up 
first...

Thijs

On 11-3-2011 12:33, Pedro Santos wrote:
> looks like a bug, open a ticket + quickstart please
>
> On Fri, Mar 11, 2011 at 8:08 AM, Thijs<vo...@gmail.com>  wrote:
>
>> Hi,
>>
>> I have the following issue.
>> I have a separate js that on window.onload calls:
>> Wicket.Ajax.registerPreCallHandler(foo);
>> Wicket.Ajax.registerPostCallHandler(bar);
>> Wicket.Ajax.registerFailureHandler(bar);
>> This works great however not on the first page load when there is no
>> session yet.
>>
>> The session starts on the page visited so every resource gets
>> ;sessionid=xyz appended
>>
>> http://localhost:8080/xyz/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=48703E4E37189E284112EA7A8CD6F8DB?w:lm=1299841674
>> Then on the first ajax-call it re-downloads all resources (including
>> wicket-event.js and wicket-ajax.js) but this time without the ;sessionid
>> appended. This seems to cause the registration of the pre and post handlers
>> to be forgotten. And they are never called again.
>>
>> So I have 2 questions.
>> 1. How can I prevent the resources from being downloaded twice (which would
>> prevent the issue from happening in the first place).
>> 2. If 1. can't be done. How can I re-register the pre and post handlers? So
>> that subsequent ajax calls keep calling my Javascript in there pre and post
>> calls?
>>
>> thanks
>>
>> Thijs
>>
>>
>> ---------------------------------------------------------------------
>> 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: problem using pre & post ajax handlers

Posted by Pedro Santos <pe...@gmail.com>.
looks like a bug, open a ticket + quickstart please

On Fri, Mar 11, 2011 at 8:08 AM, Thijs <vo...@gmail.com> wrote:

> Hi,
>
> I have the following issue.
> I have a separate js that on window.onload calls:
> Wicket.Ajax.registerPreCallHandler(foo);
> Wicket.Ajax.registerPostCallHandler(bar);
> Wicket.Ajax.registerFailureHandler(bar);
> This works great however not on the first page load when there is no
> session yet.
>
> The session starts on the page visited so every resource gets
> ;sessionid=xyz appended
>
> http://localhost:8080/xyz/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=48703E4E37189E284112EA7A8CD6F8DB?w:lm=1299841674
> Then on the first ajax-call it re-downloads all resources (including
> wicket-event.js and wicket-ajax.js) but this time without the ;sessionid
> appended. This seems to cause the registration of the pre and post handlers
> to be forgotten. And they are never called again.
>
> So I have 2 questions.
> 1. How can I prevent the resources from being downloaded twice (which would
> prevent the issue from happening in the first place).
> 2. If 1. can't be done. How can I re-register the pre and post handlers? So
> that subsequent ajax calls keep calling my Javascript in there pre and post
> calls?
>
> thanks
>
> Thijs
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos