You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Mikko Pukki (JIRA)" <ji...@apache.org> on 2008/12/08 14:48:46 UTC

[jira] Commented: (WICKET-1971) AjaxSelfUpdatingBehavior problem with HttpSessionStore

    [ https://issues.apache.org/jira/browse/WICKET-1971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654415#action_12654415 ] 

Mikko Pukki commented on WICKET-1971:
-------------------------------------

Co-worker of mine noticed that when request from AjaxSelfUpdatingBehavior is decoded in class WebRequestCodingStrategy, 
if clause on line 202 is not executed. 

if (request.getParameter(IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME) != null) 
{ 
parameters.setOnlyProcessIfPathActive(true); 
} 

Map that is retrieved from request on line 207: "Map map = request.getParameterMap();" 
holds key: "amp;wicket:ignoreIfNotActive". I quess that it should contain "wicket:ignoreIfNotActive". 
I tested by replacing line 202 with: if (request.getParameter(IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME) != null || request.getParameter("amp;" + IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME) != null) 

Then it worked.. 

I also noticed strange behavior with testing Jetty Server. If I open the HomePage second time with the same browser, then the quickstart runs fine.


> AjaxSelfUpdatingBehavior problem with HttpSessionStore
> ------------------------------------------------------
>
>                 Key: WICKET-1971
>                 URL: https://issues.apache.org/jira/browse/WICKET-1971
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Mikko Pukki
>         Attachments: ajaxSelfUpdateTest.zip
>
>
> Issue is discussed at:
> http://www.nabble.com/AjaxSelfUpdatingBehavior-problem-with-HttpSessionStore-to20841818.html#a20842209
> We discovered a problem when using AjaxSelfUpdatingbehavior combined
> with ajax buttons (when ajax button forwards to another page (let's call is PageB) by
> setResponsePage method).
> When a user hits a button and immediately after that an ajax request is fired by the
> AjaxSelfUpdatingbehavior, AccessStackPageMap thinks that user has pressed back button.
> This is what happens when this behavior occurs:
> 1) User pressed an ajax button
> 2) AjaxSelUpdatingBehavior fires another ajax request right after user pressed button
> 3) User ends up on PageB
> 4) now pressing ajax buttons on a new page has no effect
>     WebRequestCycleProcessor's resolve method goes now to line 114:
>        if (pageId != access.getId())
>        {
>         // the page is no longer the active page
>         // - ignore this request
>         processRequest = false;
>        }
>   Wicket Ajax Debug prints something like this:
>     INFO: Initiating Ajax POST request on ?    wicket:interface=:1:inputForm:back::IActivePageBehaviorListener:0:&wicket:ignoreIfNotActive=true&random=0.6741350924814413
>     INFO: Invoking pre-call handler(s)...
>     INFO: Received ajax response (31 characters)
>     INFO:
>     <ajax-response></ajax-response>
>     ERROR: Error while parsing response: Could not find root <ajax-response> element
>     INFO: Invoking post-call handler(s)...
> We debugged around a bit and discovered that when this behavior happens, AccessStackPageMap's
> accept method is called with instance of PageB as entry parameter. But instantly after that a request
> that came from AjaxSelfUpdatingBehavior calls also AccessStackPageMap's
> accept method (entry is now the page where AjaxSelfUpdatingBehavior was added). Now reference
> of PageB is removed from stack and AccessStackPagemap thinks that user is on previous page while user
> is really on PageB.
> I made simplest possible quickstart application that behaves like this. I put an AjaxSelfUpdatingBehavior to
> update a component on a page at 2 second intervals. Then I added an Ajax link and in its onSubmit method I
> put thread to sleep for 3 seconds before setResponsePage is called. That way this behavior can be repeated
> always when pressing the button. If the sleep is removed then of course this happens rarely, but in our real
> life application it shows up very frequently.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.