You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Christopher Merrill <ch...@webperformance.com> on 2015/05/14 20:40:57 UTC

How could refreshing a page cause future onClick() listeners to malfunction?

I'm seeing problems throughout our app where refreshing the page causes
other event listeners to then malfunction. These are trivially simple
listeners, like:

Link customer_link = new Link("org_link")
    {
    @Override
    public void onClick()
        {
        setResponsePage(new
OrganizationAdministrationPage(getPageReference(),
_organization_key));
        }

    private static final long serialVersionUID = -6396556709778260098L;
    };


Instead of returning the response page, the browser receives a forward
(302) back to the same page instance...which of course means that the link
appears to do nothing.

I can only reproduce this behavior when the app is deployed to AppEngine --
it works fine running on my desktop. The problems started when we upgraded
the application to Wicket 6. I'm not implying this is a Wicket 6
problem...in fact I assume we have done something that is causing this
malfunction. But since it worked under Wicket 5, I'm hoping someone will
see a relationship between the symptoms and a change that we need to make
for compatibility with Wicket 6.

Any hints or debugging ideas (since I can't step through the code running
in AppEngine) would be greatly appreciated!

Chris

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Martin Grigorov <mg...@apache.org>.
Please create a pull request at gae-initializer project .
On May 15, 2015 6:00 PM, "Christopher Merrill" <ch...@webperformance.com>
wrote:

> On Fri, May 15, 2015 at 10:33 AM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > I am puzzled why people use AppEngine in first place. It has so many
> > restrictions. It looks like a pain to me to develop for this platform.
> >
>
> It does have a lot of restrictions, but if you can live with / adapt to
> those, GAE has a lot of benefits. We never, ever have to put one moments
> though into hardware. We can have multiple different versions of the app
> running live at any time, which is great for testing. Deployment is
> trivially easy. If we find a bug, we can revert to a previous version with
> a few clicks and users are instantly moved over to it. For our app, which
> is a 24x7 customer service app, downtime has never been a problem in 4
> years since we deployed. I can't say that about our EC2 VMs. And since our
> app is relatively lightly used (with occasional bursts of heavy use), the
> hosting costs are ridiculously cheap. I'm not sure if there are better
> alternatives today (I seem to recall looking at Elastic Beanstalk), but I'm
> happy with the decision to build on AppEngine. We do seem to be in a
> minority, though.
>
>
> > We can add IRequestCycleListener to gae-initializer!
> > But so far you are the only user who complains about this problem ...
> >
>
> So do you think we should just let this discussion thread be the
> documentation for anyone who may run into this in the future? Or perhaps
> open an issue to document it. I'm OK with either...and willing to help
> further as needed.
>
> Chris
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Christopher Merrill <ch...@webperformance.com>.
On Fri, May 15, 2015 at 10:33 AM, Martin Grigorov <mg...@apache.org>
wrote:

> I am puzzled why people use AppEngine in first place. It has so many
> restrictions. It looks like a pain to me to develop for this platform.
>

It does have a lot of restrictions, but if you can live with / adapt to
those, GAE has a lot of benefits. We never, ever have to put one moments
though into hardware. We can have multiple different versions of the app
running live at any time, which is great for testing. Deployment is
trivially easy. If we find a bug, we can revert to a previous version with
a few clicks and users are instantly moved over to it. For our app, which
is a 24x7 customer service app, downtime has never been a problem in 4
years since we deployed. I can't say that about our EC2 VMs. And since our
app is relatively lightly used (with occasional bursts of heavy use), the
hosting costs are ridiculously cheap. I'm not sure if there are better
alternatives today (I seem to recall looking at Elastic Beanstalk), but I'm
happy with the decision to build on AppEngine. We do seem to be in a
minority, though.


> We can add IRequestCycleListener to gae-initializer!
> But so far you are the only user who complains about this problem ...
>

So do you think we should just let this discussion thread be the
documentation for anyone who may run into this in the future? Or perhaps
open an issue to document it. I'm OK with either...and willing to help
further as needed.

Chris

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Martin Grigorov <mg...@apache.org>.
On Fri, May 15, 2015 at 5:15 PM, Christopher Merrill <
chris@webperformance.com> wrote:

> Adding an IRequestCycleListener that put a new value into the session at
> the end of each request DOES fix the problem. As you noted, it fixed my
> stripped-down example. I have tested all of the symptoms I have mentioned
> in previous related posts and they are ALL fixed :>
>
> Overriding our session class's equals() method to return false did NOT
> solve the problem in my stripped-down example and I did not investigate
> that approach any further.
>
>
> Thanks so much, Martin, for your help on this!!  I can't properly express
> how grateful I am.  I don't know how long it would have taken for me to
> track that down without your help, but there would have been a lot of
> unhappiness along the way, I am sure :)
>

Welcome!


>
>
> I have a fix that I can proceed with, but I am puzzled why other
> Wicket/AppEngine users do not see this problem. It seems like nearly every
>

I am puzzled why people use AppEngine in first place. It has so many
restrictions. It looks like a pain to me to develop for this platform.


> Wicket app on GAE should be affected. Is there any more investigation you
> can recommend that might shed light on that? I'd like to either (1) figure
> out what we've done to aggravate this problem and fix it...or (2) get an
> appropriate fix into Wicket or GAE-Initializer, if that is the right thing
> to do.
>

We can add IRequestCycleListener to gae-initializer!
But so far you are the only user who complains about this problem ...


>
>
> Chris
>
>
>
>
> On Fri, May 15, 2015 at 9:24 AM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > On Fri, May 15, 2015 at 4:16 PM, Christopher Merrill <
> > chris@webperformance.com> wrote:
> >
> > > Wow, that makes sense - and I _think_ it explains the symptoms I've
> seen
> > > with other problems as well. I'll have to re-investigate those.
> > >
> > > The issue you mentioned is marked as resolved in  6.12 and the related
> > > issue (WICKET-5473) was fixed in 6.14. We are running 6.19. So I must
> be
> > > reading those descriptions wrong...or this problem is somehow
> different.
> > >
> >
> > You read it correct. It should be fixed.
> > I don't know which version of Jetty AppEngine uses and what kind of
> checks
> > it does.
> > I just remembered about the symptoms in WICKET-5390 and thought that it
> > could be the same issue.
> >
> >
> > >
> > > Anyway, I'll test your suggestion (or perhaps override
> > > WebSession.equals()?).
> > >
> >
> > Test all of them.
> >
> >
> > >
> > > Chris
> > >
> > > On Fri, May 15, 2015 at 3:50 AM, Martin Grigorov <mgrigorov@apache.org
> >
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > AppEngine uses Jetty and I remembered about
> > > > https://issues.apache.org/jira/browse/WICKET-5390.
> > > > Here the reporter explains that Jetty won't update its SessionStore
> if
> > it
> > > > believes the http session didn't change.
> > > > Wicket stores both o.a.w.Session and all pages rendered in the last
> > > request
> > > > as attributes in the http session.
> > > > If Jetty doesn't detect the change(s) in the http session it will not
> > > store
> > > > it and later will serve a http session with obsolete data inside.
> > > > By doing "getSession().setAttribute("blah", somethingRandom)" we try
> to
> > > > help Jetty realize that there is a change and make sure it saves the
> > > latest
> > > > state.
> > > > You can move this helper code in IRequestCycleListener#onEndRequest()
> > so
> > > it
> > > > is executed for every request.
> > > > If I am correct then this should workaround the problem.
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Fri, May 15, 2015 at 12:00 AM, Christopher Merrill <
> > > > chris@webperformance.com> wrote:
> > > >
> > > > > Oh, and what you probably also wanted to know: When I press refresh
> > on
> > > > the
> > > > > page, the message from the constructor does not appear in the logs
> > > again.
> > > > > Also nothing after pressing the button (which does nothing).
> > > > >
> > > > > On Thu, May 14, 2015 at 4:50 PM, Christopher Merrill <
> > > > > chris@webperformance.com> wrote:
> > > > >
> > > > > > I added the getSession().setAttribute() into the page
> constructor.
> > > > When I
> > > > > > hit the page, I see two lines in the AppEngine logs. The first is
> > for
> > > > the
> > > > > > URL I put in the browser (/portal/pages/Test), which indicates a
> > 302
> > > > > > response to the browser and the log entry also contains the debug
> > > > message
> > > > > > that I included along with the setAttribute() line.
> > > > > >
> > > > > > The next line in the logs is for URL /portal/pages/Test?1 and is
> a
> > > 200
> > > > > > response with the page content.
> > > > > >
> > > > > > Does that help?
> > > > > >
> > > > > > Chris
> > > > > >
> > > > > > On Thu, May 14, 2015 at 4:42 PM, Christopher Merrill <
> > > > > > chris@webperformance.com> wrote:
> > > > > >
> > > > > >> I added that line, along with
> > > > > >>   Debug.log.out("the test attribute is: " +
> > > > > >> getSession().getAttribute("test"));
> > > > > >> in the onSubmit() method of the AjaxButton.
> > > > > >>
> > > > > >> If I DO NOT refresh the page before pressing the button, then it
> > > > prints
> > > > > >> the message with the date in the logs.
> > > > > >>
> > > > > >> If I do refresh the page, nothing...which I take to mean that
> the
> > > code
> > > > > >> never runs.
> > > > > >>
> > > > > >> I'll try it in the constructor for the page.
> > > > > >>
> > > > > >> Chris
> > > > > >>
> > > > > >>
> > > > > >> On Thu, May 14, 2015 at 4:35 PM, Martin Grigorov <
> > > > mgrigorov@apache.org>
> > > > > >> wrote:
> > > > > >>
> > > > > >>> OK, then also put the same line in some constructor that is
> > > invoked.
> > > > > >>>
> > > > > >>> Martin Grigorov
> > > > > >>> Wicket Training and Consulting
> > > > > >>> https://twitter.com/mtgrigorov
> > > > > >>>
> > > > > >>> On Thu, May 14, 2015 at 11:32 PM, Christopher Merrill <
> > > > > >>> chris@webperformance.com> wrote:
> > > > > >>>
> > > > > >>> > I'll do that. It'll take a few minutes to deploy that back up
> > to
> > > > > >>> AppEngine.
> > > > > >>> >
> > > > > >>> > But I don't think that code will be executed - I feel pretty
> > > > > confident
> > > > > >>> that
> > > > > >>> > the event listeners are not being invoked. At least, my debug
> > > > > >>> statements in
> > > > > >>> > the event listener do not get into the AppEngine logs.
> > > > > >>> >
> > > > > >>> > Chris
> > > > > >>> >
> > > > > >>> >
> > > > > >>> > On Thu, May 14, 2015 at 4:23 PM, Martin Grigorov <
> > > > > mgrigorov@apache.org
> > > > > >>> >
> > > > > >>> > wrote:
> > > > > >>> >
> > > > > >>> > > Can you try something else:
> > > > > >>> > > in onClick() add code like: getSession.setAttribute("test",
> > new
> > > > > >>> Date())
> > > > > >>> > >
> > > > > >>> > > Martin Grigorov
> > > > > >>> > > Wicket Training and Consulting
> > > > > >>> > > https://twitter.com/mtgrigorov
> > > > > >>> > >
> > > > > >>> > > On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
> > > > > >>> > > chris@webperformance.com> wrote:
> > > > > >>> > >
> > > > > >>> > > > Thanks for your help, Martin!
> > > > > >>> > > >
> > > > > >>> > > > I turned off page recreation by adding:
> > > > > >>> > > >
> > > > > >>> > > >
> > getPageSettings().setRecreateMountedPagesAfterExpiry(false);
> > > > > >>> > > >
> > > > > >>> > > > to my Application.init() method.
> > > > > >>> > > >
> > > > > >>> > > > There is no change in the behavior, either locally or in
> > > > > AppEngine
> > > > > >>> --
> > > > > >>> > > i.e.
> > > > > >>> > > > no page expired errors.
> > > > > >>> > > >
> > > > > >>> > > > You can observe the behavior here:
> > > > > >>> > > > http://1.wp-portal-staging.appspot.com/portal/pages/Test
> > > > > >>> > > >
> > > > > >>> > > > by visiting the page, refreshing it and then pressing a
> > > button
> > > > > >>> (which
> > > > > >>> > > will
> > > > > >>> > > > do nothing if you refreshed). I posted the code for that
> > page
> > > > in
> > > > > >>> > another
> > > > > >>> > > > thread ("Model value change lost between
> > > AjaxButton.onSubmit()
> > > > > and
> > > > > >>> > > > form.onSubmit()"), in case that helps.
> > > > > >>> > > >
> > > > > >>> > > > TIA!
> > > > > >>> > > > Chris
> > > > > >>> > > >
> > > > > >>> > > >
> > > > > >>> > > >
> > > > > >>> > > > On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <
> > > > > >>> mgrigorov@apache.org
> > > > > >>> > >
> > > > > >>> > > > wrote:
> > > > > >>> > > >
> > > > > >>> > > > > Hi,
> > > > > >>> > > > >
> > > > > >>> > > > > My guess is that there is some problem with the saving
> of
> > > the
> > > > > >>> page in
> > > > > >>> > > the
> > > > > >>> > > > > backing stores.
> > > > > >>> > > > > Try by disabling page recreation for expired pages, see
> > > > > >>> > IPageSettings,
> > > > > >>> > > > > If I'm right then you should start seeing
> PageExpiredPage
> > > > after
> > > > > >>> > > clicking
> > > > > >>> > > > > the link.
> > > > > >>> > > > > The next step is will be to find why the pages could
> not
> > be
> > > > > >>> stored.
> > > > > >>> > > > >
> > > > > >>> > > > > Martin Grigorov
> > > > > >>> > > > > Wicket Training and Consulting
> > > > > >>> > > > > https://twitter.com/mtgrigorov
> > > > > >>> > > > >
> > > > > >>> > > > > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
> > > > > >>> > > > > chris@webperformance.com> wrote:
> > > > > >>> > > > >
> > > > > >>> > > > > > I'm seeing problems throughout our app where
> refreshing
> > > the
> > > > > >>> page
> > > > > >>> > > causes
> > > > > >>> > > > > > other event listeners to then malfunction. These are
> > > > > trivially
> > > > > >>> > simple
> > > > > >>> > > > > > listeners, like:
> > > > > >>> > > > > >
> > > > > >>> > > > > > Link customer_link = new Link("org_link")
> > > > > >>> > > > > >     {
> > > > > >>> > > > > >     @Override
> > > > > >>> > > > > >     public void onClick()
> > > > > >>> > > > > >         {
> > > > > >>> > > > > >         setResponsePage(new
> > > > > >>> > > > > > OrganizationAdministrationPage(getPageReference(),
> > > > > >>> > > > > > _organization_key));
> > > > > >>> > > > > >         }
> > > > > >>> > > > > >
> > > > > >>> > > > > >     private static final long serialVersionUID =
> > > > > >>> > > -6396556709778260098L;
> > > > > >>> > > > > >     };
> > > > > >>> > > > > >
> > > > > >>> > > > > >
> > > > > >>> > > > > > Instead of returning the response page, the browser
> > > > receives
> > > > > a
> > > > > >>> > > forward
> > > > > >>> > > > > > (302) back to the same page instance...which of
> course
> > > > means
> > > > > >>> that
> > > > > >>> > the
> > > > > >>> > > > > link
> > > > > >>> > > > > > appears to do nothing.
> > > > > >>> > > > > >
> > > > > >>> > > > > > I can only reproduce this behavior when the app is
> > > deployed
> > > > > to
> > > > > >>> > > > AppEngine
> > > > > >>> > > > > --
> > > > > >>> > > > > > it works fine running on my desktop. The problems
> > started
> > > > > when
> > > > > >>> we
> > > > > >>> > > > > upgraded
> > > > > >>> > > > > > the application to Wicket 6. I'm not implying this
> is a
> > > > > Wicket
> > > > > >>> 6
> > > > > >>> > > > > > problem...in fact I assume we have done something
> that
> > is
> > > > > >>> causing
> > > > > >>> > > this
> > > > > >>> > > > > > malfunction. But since it worked under Wicket 5, I'm
> > > hoping
> > > > > >>> someone
> > > > > >>> > > > will
> > > > > >>> > > > > > see a relationship between the symptoms and a change
> > that
> > > > we
> > > > > >>> need
> > > > > >>> > to
> > > > > >>> > > > make
> > > > > >>> > > > > > for compatibility with Wicket 6.
> > > > > >>> > > > > >
> > > > > >>> > > > > > Any hints or debugging ideas (since I can't step
> > through
> > > > the
> > > > > >>> code
> > > > > >>> > > > running
> > > > > >>> > > > > > in AppEngine) would be greatly appreciated!
> > > > > >>> > > > > >
> > > > > >>> > > > > > Chris
> > > > > >>> > > > > >
> > > > > >>> > > > >
> > > > > >>> > > >
> > > > > >>> > >
> > > > > >>> >
> > > > > >>>
> > > > > >>
> > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Christopher Merrill <ch...@webperformance.com>.
Adding an IRequestCycleListener that put a new value into the session at
the end of each request DOES fix the problem. As you noted, it fixed my
stripped-down example. I have tested all of the symptoms I have mentioned
in previous related posts and they are ALL fixed :>

Overriding our session class's equals() method to return false did NOT
solve the problem in my stripped-down example and I did not investigate
that approach any further.


Thanks so much, Martin, for your help on this!!  I can't properly express
how grateful I am.  I don't know how long it would have taken for me to
track that down without your help, but there would have been a lot of
unhappiness along the way, I am sure :)


I have a fix that I can proceed with, but I am puzzled why other
Wicket/AppEngine users do not see this problem. It seems like nearly every
Wicket app on GAE should be affected. Is there any more investigation you
can recommend that might shed light on that? I'd like to either (1) figure
out what we've done to aggravate this problem and fix it...or (2) get an
appropriate fix into Wicket or GAE-Initializer, if that is the right thing
to do.


Chris




On Fri, May 15, 2015 at 9:24 AM, Martin Grigorov <mg...@apache.org>
wrote:

> On Fri, May 15, 2015 at 4:16 PM, Christopher Merrill <
> chris@webperformance.com> wrote:
>
> > Wow, that makes sense - and I _think_ it explains the symptoms I've seen
> > with other problems as well. I'll have to re-investigate those.
> >
> > The issue you mentioned is marked as resolved in  6.12 and the related
> > issue (WICKET-5473) was fixed in 6.14. We are running 6.19. So I must be
> > reading those descriptions wrong...or this problem is somehow different.
> >
>
> You read it correct. It should be fixed.
> I don't know which version of Jetty AppEngine uses and what kind of checks
> it does.
> I just remembered about the symptoms in WICKET-5390 and thought that it
> could be the same issue.
>
>
> >
> > Anyway, I'll test your suggestion (or perhaps override
> > WebSession.equals()?).
> >
>
> Test all of them.
>
>
> >
> > Chris
> >
> > On Fri, May 15, 2015 at 3:50 AM, Martin Grigorov <mg...@apache.org>
> > wrote:
> >
> > > Hi,
> > >
> > > AppEngine uses Jetty and I remembered about
> > > https://issues.apache.org/jira/browse/WICKET-5390.
> > > Here the reporter explains that Jetty won't update its SessionStore if
> it
> > > believes the http session didn't change.
> > > Wicket stores both o.a.w.Session and all pages rendered in the last
> > request
> > > as attributes in the http session.
> > > If Jetty doesn't detect the change(s) in the http session it will not
> > store
> > > it and later will serve a http session with obsolete data inside.
> > > By doing "getSession().setAttribute("blah", somethingRandom)" we try to
> > > help Jetty realize that there is a change and make sure it saves the
> > latest
> > > state.
> > > You can move this helper code in IRequestCycleListener#onEndRequest()
> so
> > it
> > > is executed for every request.
> > > If I am correct then this should workaround the problem.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Fri, May 15, 2015 at 12:00 AM, Christopher Merrill <
> > > chris@webperformance.com> wrote:
> > >
> > > > Oh, and what you probably also wanted to know: When I press refresh
> on
> > > the
> > > > page, the message from the constructor does not appear in the logs
> > again.
> > > > Also nothing after pressing the button (which does nothing).
> > > >
> > > > On Thu, May 14, 2015 at 4:50 PM, Christopher Merrill <
> > > > chris@webperformance.com> wrote:
> > > >
> > > > > I added the getSession().setAttribute() into the page constructor.
> > > When I
> > > > > hit the page, I see two lines in the AppEngine logs. The first is
> for
> > > the
> > > > > URL I put in the browser (/portal/pages/Test), which indicates a
> 302
> > > > > response to the browser and the log entry also contains the debug
> > > message
> > > > > that I included along with the setAttribute() line.
> > > > >
> > > > > The next line in the logs is for URL /portal/pages/Test?1 and is a
> > 200
> > > > > response with the page content.
> > > > >
> > > > > Does that help?
> > > > >
> > > > > Chris
> > > > >
> > > > > On Thu, May 14, 2015 at 4:42 PM, Christopher Merrill <
> > > > > chris@webperformance.com> wrote:
> > > > >
> > > > >> I added that line, along with
> > > > >>   Debug.log.out("the test attribute is: " +
> > > > >> getSession().getAttribute("test"));
> > > > >> in the onSubmit() method of the AjaxButton.
> > > > >>
> > > > >> If I DO NOT refresh the page before pressing the button, then it
> > > prints
> > > > >> the message with the date in the logs.
> > > > >>
> > > > >> If I do refresh the page, nothing...which I take to mean that the
> > code
> > > > >> never runs.
> > > > >>
> > > > >> I'll try it in the constructor for the page.
> > > > >>
> > > > >> Chris
> > > > >>
> > > > >>
> > > > >> On Thu, May 14, 2015 at 4:35 PM, Martin Grigorov <
> > > mgrigorov@apache.org>
> > > > >> wrote:
> > > > >>
> > > > >>> OK, then also put the same line in some constructor that is
> > invoked.
> > > > >>>
> > > > >>> Martin Grigorov
> > > > >>> Wicket Training and Consulting
> > > > >>> https://twitter.com/mtgrigorov
> > > > >>>
> > > > >>> On Thu, May 14, 2015 at 11:32 PM, Christopher Merrill <
> > > > >>> chris@webperformance.com> wrote:
> > > > >>>
> > > > >>> > I'll do that. It'll take a few minutes to deploy that back up
> to
> > > > >>> AppEngine.
> > > > >>> >
> > > > >>> > But I don't think that code will be executed - I feel pretty
> > > > confident
> > > > >>> that
> > > > >>> > the event listeners are not being invoked. At least, my debug
> > > > >>> statements in
> > > > >>> > the event listener do not get into the AppEngine logs.
> > > > >>> >
> > > > >>> > Chris
> > > > >>> >
> > > > >>> >
> > > > >>> > On Thu, May 14, 2015 at 4:23 PM, Martin Grigorov <
> > > > mgrigorov@apache.org
> > > > >>> >
> > > > >>> > wrote:
> > > > >>> >
> > > > >>> > > Can you try something else:
> > > > >>> > > in onClick() add code like: getSession.setAttribute("test",
> new
> > > > >>> Date())
> > > > >>> > >
> > > > >>> > > Martin Grigorov
> > > > >>> > > Wicket Training and Consulting
> > > > >>> > > https://twitter.com/mtgrigorov
> > > > >>> > >
> > > > >>> > > On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
> > > > >>> > > chris@webperformance.com> wrote:
> > > > >>> > >
> > > > >>> > > > Thanks for your help, Martin!
> > > > >>> > > >
> > > > >>> > > > I turned off page recreation by adding:
> > > > >>> > > >
> > > > >>> > > >
> getPageSettings().setRecreateMountedPagesAfterExpiry(false);
> > > > >>> > > >
> > > > >>> > > > to my Application.init() method.
> > > > >>> > > >
> > > > >>> > > > There is no change in the behavior, either locally or in
> > > > AppEngine
> > > > >>> --
> > > > >>> > > i.e.
> > > > >>> > > > no page expired errors.
> > > > >>> > > >
> > > > >>> > > > You can observe the behavior here:
> > > > >>> > > > http://1.wp-portal-staging.appspot.com/portal/pages/Test
> > > > >>> > > >
> > > > >>> > > > by visiting the page, refreshing it and then pressing a
> > button
> > > > >>> (which
> > > > >>> > > will
> > > > >>> > > > do nothing if you refreshed). I posted the code for that
> page
> > > in
> > > > >>> > another
> > > > >>> > > > thread ("Model value change lost between
> > AjaxButton.onSubmit()
> > > > and
> > > > >>> > > > form.onSubmit()"), in case that helps.
> > > > >>> > > >
> > > > >>> > > > TIA!
> > > > >>> > > > Chris
> > > > >>> > > >
> > > > >>> > > >
> > > > >>> > > >
> > > > >>> > > > On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <
> > > > >>> mgrigorov@apache.org
> > > > >>> > >
> > > > >>> > > > wrote:
> > > > >>> > > >
> > > > >>> > > > > Hi,
> > > > >>> > > > >
> > > > >>> > > > > My guess is that there is some problem with the saving of
> > the
> > > > >>> page in
> > > > >>> > > the
> > > > >>> > > > > backing stores.
> > > > >>> > > > > Try by disabling page recreation for expired pages, see
> > > > >>> > IPageSettings,
> > > > >>> > > > > If I'm right then you should start seeing PageExpiredPage
> > > after
> > > > >>> > > clicking
> > > > >>> > > > > the link.
> > > > >>> > > > > The next step is will be to find why the pages could not
> be
> > > > >>> stored.
> > > > >>> > > > >
> > > > >>> > > > > Martin Grigorov
> > > > >>> > > > > Wicket Training and Consulting
> > > > >>> > > > > https://twitter.com/mtgrigorov
> > > > >>> > > > >
> > > > >>> > > > > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
> > > > >>> > > > > chris@webperformance.com> wrote:
> > > > >>> > > > >
> > > > >>> > > > > > I'm seeing problems throughout our app where refreshing
> > the
> > > > >>> page
> > > > >>> > > causes
> > > > >>> > > > > > other event listeners to then malfunction. These are
> > > > trivially
> > > > >>> > simple
> > > > >>> > > > > > listeners, like:
> > > > >>> > > > > >
> > > > >>> > > > > > Link customer_link = new Link("org_link")
> > > > >>> > > > > >     {
> > > > >>> > > > > >     @Override
> > > > >>> > > > > >     public void onClick()
> > > > >>> > > > > >         {
> > > > >>> > > > > >         setResponsePage(new
> > > > >>> > > > > > OrganizationAdministrationPage(getPageReference(),
> > > > >>> > > > > > _organization_key));
> > > > >>> > > > > >         }
> > > > >>> > > > > >
> > > > >>> > > > > >     private static final long serialVersionUID =
> > > > >>> > > -6396556709778260098L;
> > > > >>> > > > > >     };
> > > > >>> > > > > >
> > > > >>> > > > > >
> > > > >>> > > > > > Instead of returning the response page, the browser
> > > receives
> > > > a
> > > > >>> > > forward
> > > > >>> > > > > > (302) back to the same page instance...which of course
> > > means
> > > > >>> that
> > > > >>> > the
> > > > >>> > > > > link
> > > > >>> > > > > > appears to do nothing.
> > > > >>> > > > > >
> > > > >>> > > > > > I can only reproduce this behavior when the app is
> > deployed
> > > > to
> > > > >>> > > > AppEngine
> > > > >>> > > > > --
> > > > >>> > > > > > it works fine running on my desktop. The problems
> started
> > > > when
> > > > >>> we
> > > > >>> > > > > upgraded
> > > > >>> > > > > > the application to Wicket 6. I'm not implying this is a
> > > > Wicket
> > > > >>> 6
> > > > >>> > > > > > problem...in fact I assume we have done something that
> is
> > > > >>> causing
> > > > >>> > > this
> > > > >>> > > > > > malfunction. But since it worked under Wicket 5, I'm
> > hoping
> > > > >>> someone
> > > > >>> > > > will
> > > > >>> > > > > > see a relationship between the symptoms and a change
> that
> > > we
> > > > >>> need
> > > > >>> > to
> > > > >>> > > > make
> > > > >>> > > > > > for compatibility with Wicket 6.
> > > > >>> > > > > >
> > > > >>> > > > > > Any hints or debugging ideas (since I can't step
> through
> > > the
> > > > >>> code
> > > > >>> > > > running
> > > > >>> > > > > > in AppEngine) would be greatly appreciated!
> > > > >>> > > > > >
> > > > >>> > > > > > Chris
> > > > >>> > > > > >
> > > > >>> > > > >
> > > > >>> > > >
> > > > >>> > >
> > > > >>> >
> > > > >>>
> > > > >>
> > > > >>
> > > > >
> > > >
> > >
> >
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Martin Grigorov <mg...@apache.org>.
On Fri, May 15, 2015 at 4:16 PM, Christopher Merrill <
chris@webperformance.com> wrote:

> Wow, that makes sense - and I _think_ it explains the symptoms I've seen
> with other problems as well. I'll have to re-investigate those.
>
> The issue you mentioned is marked as resolved in  6.12 and the related
> issue (WICKET-5473) was fixed in 6.14. We are running 6.19. So I must be
> reading those descriptions wrong...or this problem is somehow different.
>

You read it correct. It should be fixed.
I don't know which version of Jetty AppEngine uses and what kind of checks
it does.
I just remembered about the symptoms in WICKET-5390 and thought that it
could be the same issue.


>
> Anyway, I'll test your suggestion (or perhaps override
> WebSession.equals()?).
>

Test all of them.


>
> Chris
>
> On Fri, May 15, 2015 at 3:50 AM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Hi,
> >
> > AppEngine uses Jetty and I remembered about
> > https://issues.apache.org/jira/browse/WICKET-5390.
> > Here the reporter explains that Jetty won't update its SessionStore if it
> > believes the http session didn't change.
> > Wicket stores both o.a.w.Session and all pages rendered in the last
> request
> > as attributes in the http session.
> > If Jetty doesn't detect the change(s) in the http session it will not
> store
> > it and later will serve a http session with obsolete data inside.
> > By doing "getSession().setAttribute("blah", somethingRandom)" we try to
> > help Jetty realize that there is a change and make sure it saves the
> latest
> > state.
> > You can move this helper code in IRequestCycleListener#onEndRequest() so
> it
> > is executed for every request.
> > If I am correct then this should workaround the problem.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Fri, May 15, 2015 at 12:00 AM, Christopher Merrill <
> > chris@webperformance.com> wrote:
> >
> > > Oh, and what you probably also wanted to know: When I press refresh on
> > the
> > > page, the message from the constructor does not appear in the logs
> again.
> > > Also nothing after pressing the button (which does nothing).
> > >
> > > On Thu, May 14, 2015 at 4:50 PM, Christopher Merrill <
> > > chris@webperformance.com> wrote:
> > >
> > > > I added the getSession().setAttribute() into the page constructor.
> > When I
> > > > hit the page, I see two lines in the AppEngine logs. The first is for
> > the
> > > > URL I put in the browser (/portal/pages/Test), which indicates a 302
> > > > response to the browser and the log entry also contains the debug
> > message
> > > > that I included along with the setAttribute() line.
> > > >
> > > > The next line in the logs is for URL /portal/pages/Test?1 and is a
> 200
> > > > response with the page content.
> > > >
> > > > Does that help?
> > > >
> > > > Chris
> > > >
> > > > On Thu, May 14, 2015 at 4:42 PM, Christopher Merrill <
> > > > chris@webperformance.com> wrote:
> > > >
> > > >> I added that line, along with
> > > >>   Debug.log.out("the test attribute is: " +
> > > >> getSession().getAttribute("test"));
> > > >> in the onSubmit() method of the AjaxButton.
> > > >>
> > > >> If I DO NOT refresh the page before pressing the button, then it
> > prints
> > > >> the message with the date in the logs.
> > > >>
> > > >> If I do refresh the page, nothing...which I take to mean that the
> code
> > > >> never runs.
> > > >>
> > > >> I'll try it in the constructor for the page.
> > > >>
> > > >> Chris
> > > >>
> > > >>
> > > >> On Thu, May 14, 2015 at 4:35 PM, Martin Grigorov <
> > mgrigorov@apache.org>
> > > >> wrote:
> > > >>
> > > >>> OK, then also put the same line in some constructor that is
> invoked.
> > > >>>
> > > >>> Martin Grigorov
> > > >>> Wicket Training and Consulting
> > > >>> https://twitter.com/mtgrigorov
> > > >>>
> > > >>> On Thu, May 14, 2015 at 11:32 PM, Christopher Merrill <
> > > >>> chris@webperformance.com> wrote:
> > > >>>
> > > >>> > I'll do that. It'll take a few minutes to deploy that back up to
> > > >>> AppEngine.
> > > >>> >
> > > >>> > But I don't think that code will be executed - I feel pretty
> > > confident
> > > >>> that
> > > >>> > the event listeners are not being invoked. At least, my debug
> > > >>> statements in
> > > >>> > the event listener do not get into the AppEngine logs.
> > > >>> >
> > > >>> > Chris
> > > >>> >
> > > >>> >
> > > >>> > On Thu, May 14, 2015 at 4:23 PM, Martin Grigorov <
> > > mgrigorov@apache.org
> > > >>> >
> > > >>> > wrote:
> > > >>> >
> > > >>> > > Can you try something else:
> > > >>> > > in onClick() add code like: getSession.setAttribute("test", new
> > > >>> Date())
> > > >>> > >
> > > >>> > > Martin Grigorov
> > > >>> > > Wicket Training and Consulting
> > > >>> > > https://twitter.com/mtgrigorov
> > > >>> > >
> > > >>> > > On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
> > > >>> > > chris@webperformance.com> wrote:
> > > >>> > >
> > > >>> > > > Thanks for your help, Martin!
> > > >>> > > >
> > > >>> > > > I turned off page recreation by adding:
> > > >>> > > >
> > > >>> > > > getPageSettings().setRecreateMountedPagesAfterExpiry(false);
> > > >>> > > >
> > > >>> > > > to my Application.init() method.
> > > >>> > > >
> > > >>> > > > There is no change in the behavior, either locally or in
> > > AppEngine
> > > >>> --
> > > >>> > > i.e.
> > > >>> > > > no page expired errors.
> > > >>> > > >
> > > >>> > > > You can observe the behavior here:
> > > >>> > > > http://1.wp-portal-staging.appspot.com/portal/pages/Test
> > > >>> > > >
> > > >>> > > > by visiting the page, refreshing it and then pressing a
> button
> > > >>> (which
> > > >>> > > will
> > > >>> > > > do nothing if you refreshed). I posted the code for that page
> > in
> > > >>> > another
> > > >>> > > > thread ("Model value change lost between
> AjaxButton.onSubmit()
> > > and
> > > >>> > > > form.onSubmit()"), in case that helps.
> > > >>> > > >
> > > >>> > > > TIA!
> > > >>> > > > Chris
> > > >>> > > >
> > > >>> > > >
> > > >>> > > >
> > > >>> > > > On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <
> > > >>> mgrigorov@apache.org
> > > >>> > >
> > > >>> > > > wrote:
> > > >>> > > >
> > > >>> > > > > Hi,
> > > >>> > > > >
> > > >>> > > > > My guess is that there is some problem with the saving of
> the
> > > >>> page in
> > > >>> > > the
> > > >>> > > > > backing stores.
> > > >>> > > > > Try by disabling page recreation for expired pages, see
> > > >>> > IPageSettings,
> > > >>> > > > > If I'm right then you should start seeing PageExpiredPage
> > after
> > > >>> > > clicking
> > > >>> > > > > the link.
> > > >>> > > > > The next step is will be to find why the pages could not be
> > > >>> stored.
> > > >>> > > > >
> > > >>> > > > > Martin Grigorov
> > > >>> > > > > Wicket Training and Consulting
> > > >>> > > > > https://twitter.com/mtgrigorov
> > > >>> > > > >
> > > >>> > > > > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
> > > >>> > > > > chris@webperformance.com> wrote:
> > > >>> > > > >
> > > >>> > > > > > I'm seeing problems throughout our app where refreshing
> the
> > > >>> page
> > > >>> > > causes
> > > >>> > > > > > other event listeners to then malfunction. These are
> > > trivially
> > > >>> > simple
> > > >>> > > > > > listeners, like:
> > > >>> > > > > >
> > > >>> > > > > > Link customer_link = new Link("org_link")
> > > >>> > > > > >     {
> > > >>> > > > > >     @Override
> > > >>> > > > > >     public void onClick()
> > > >>> > > > > >         {
> > > >>> > > > > >         setResponsePage(new
> > > >>> > > > > > OrganizationAdministrationPage(getPageReference(),
> > > >>> > > > > > _organization_key));
> > > >>> > > > > >         }
> > > >>> > > > > >
> > > >>> > > > > >     private static final long serialVersionUID =
> > > >>> > > -6396556709778260098L;
> > > >>> > > > > >     };
> > > >>> > > > > >
> > > >>> > > > > >
> > > >>> > > > > > Instead of returning the response page, the browser
> > receives
> > > a
> > > >>> > > forward
> > > >>> > > > > > (302) back to the same page instance...which of course
> > means
> > > >>> that
> > > >>> > the
> > > >>> > > > > link
> > > >>> > > > > > appears to do nothing.
> > > >>> > > > > >
> > > >>> > > > > > I can only reproduce this behavior when the app is
> deployed
> > > to
> > > >>> > > > AppEngine
> > > >>> > > > > --
> > > >>> > > > > > it works fine running on my desktop. The problems started
> > > when
> > > >>> we
> > > >>> > > > > upgraded
> > > >>> > > > > > the application to Wicket 6. I'm not implying this is a
> > > Wicket
> > > >>> 6
> > > >>> > > > > > problem...in fact I assume we have done something that is
> > > >>> causing
> > > >>> > > this
> > > >>> > > > > > malfunction. But since it worked under Wicket 5, I'm
> hoping
> > > >>> someone
> > > >>> > > > will
> > > >>> > > > > > see a relationship between the symptoms and a change that
> > we
> > > >>> need
> > > >>> > to
> > > >>> > > > make
> > > >>> > > > > > for compatibility with Wicket 6.
> > > >>> > > > > >
> > > >>> > > > > > Any hints or debugging ideas (since I can't step through
> > the
> > > >>> code
> > > >>> > > > running
> > > >>> > > > > > in AppEngine) would be greatly appreciated!
> > > >>> > > > > >
> > > >>> > > > > > Chris
> > > >>> > > > > >
> > > >>> > > > >
> > > >>> > > >
> > > >>> > >
> > > >>> >
> > > >>>
> > > >>
> > > >>
> > > >
> > >
> >
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Christoph Läubrich <la...@googlemail.com>.
Since I have reported the issue and investigated a lot in that place at 
Wicket as well as Jetty side: Changing the session on each request can 
have very negative impact on performance depending on the underlying 
technology.
Even though you should never run into this issue when using the 
"traditional" PageStore Manager at all since the page store manager 
always setting it store to the session already after each request.

So can you explain if you have any custom settings/mnagers in your 
wicket app? Can you elaborate what Jetty version is used? In recent 
Wicket 6 and Jetty 9 the problem should not occur anymore.

Beside this, that the problem occurs directly after page refresh seems 
strange since this normally fixes such issues. You will see this kind of 
problem e.g. after server restart or if you stay a little on the page 
(so session data is reloaded), have heavy load so pages are evicted from 
caches etc...

Am 15.05.2015 15:16, schrieb Christopher Merrill:
> Wow, that makes sense - and I _think_ it explains the symptoms I've seen
> with other problems as well. I'll have to re-investigate those.
>
> The issue you mentioned is marked as resolved in  6.12 and the related
> issue (WICKET-5473) was fixed in 6.14. We are running 6.19. So I must be
> reading those descriptions wrong...or this problem is somehow different.
>
> Anyway, I'll test your suggestion (or perhaps override
> WebSession.equals()?).
>
> Chris
>
> On Fri, May 15, 2015 at 3:50 AM, Martin Grigorov<mg...@apache.org>
> wrote:
>
>    
>> Hi,
>>
>> AppEngine uses Jetty and I remembered about
>> https://issues.apache.org/jira/browse/WICKET-5390.
>> Here the reporter explains that Jetty won't update its SessionStore if it
>> believes the http session didn't change.
>> Wicket stores both o.a.w.Session and all pages rendered in the last request
>> as attributes in the http session.
>> If Jetty doesn't detect the change(s) in the http session it will not store
>> it and later will serve a http session with obsolete data inside.
>> By doing "getSession().setAttribute("blah", somethingRandom)" we try to
>> help Jetty realize that there is a change and make sure it saves the latest
>> state.
>> You can move this helper code in IRequestCycleListener#onEndRequest() so it
>> is executed for every request.
>> If I am correct then this should workaround the problem.
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Fri, May 15, 2015 at 12:00 AM, Christopher Merrill<
>>      


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


Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Christopher Merrill <ch...@webperformance.com>.
Wow, that makes sense - and I _think_ it explains the symptoms I've seen
with other problems as well. I'll have to re-investigate those.

The issue you mentioned is marked as resolved in  6.12 and the related
issue (WICKET-5473) was fixed in 6.14. We are running 6.19. So I must be
reading those descriptions wrong...or this problem is somehow different.

Anyway, I'll test your suggestion (or perhaps override
WebSession.equals()?).

Chris

On Fri, May 15, 2015 at 3:50 AM, Martin Grigorov <mg...@apache.org>
wrote:

> Hi,
>
> AppEngine uses Jetty and I remembered about
> https://issues.apache.org/jira/browse/WICKET-5390.
> Here the reporter explains that Jetty won't update its SessionStore if it
> believes the http session didn't change.
> Wicket stores both o.a.w.Session and all pages rendered in the last request
> as attributes in the http session.
> If Jetty doesn't detect the change(s) in the http session it will not store
> it and later will serve a http session with obsolete data inside.
> By doing "getSession().setAttribute("blah", somethingRandom)" we try to
> help Jetty realize that there is a change and make sure it saves the latest
> state.
> You can move this helper code in IRequestCycleListener#onEndRequest() so it
> is executed for every request.
> If I am correct then this should workaround the problem.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, May 15, 2015 at 12:00 AM, Christopher Merrill <
> chris@webperformance.com> wrote:
>
> > Oh, and what you probably also wanted to know: When I press refresh on
> the
> > page, the message from the constructor does not appear in the logs again.
> > Also nothing after pressing the button (which does nothing).
> >
> > On Thu, May 14, 2015 at 4:50 PM, Christopher Merrill <
> > chris@webperformance.com> wrote:
> >
> > > I added the getSession().setAttribute() into the page constructor.
> When I
> > > hit the page, I see two lines in the AppEngine logs. The first is for
> the
> > > URL I put in the browser (/portal/pages/Test), which indicates a 302
> > > response to the browser and the log entry also contains the debug
> message
> > > that I included along with the setAttribute() line.
> > >
> > > The next line in the logs is for URL /portal/pages/Test?1 and is a 200
> > > response with the page content.
> > >
> > > Does that help?
> > >
> > > Chris
> > >
> > > On Thu, May 14, 2015 at 4:42 PM, Christopher Merrill <
> > > chris@webperformance.com> wrote:
> > >
> > >> I added that line, along with
> > >>   Debug.log.out("the test attribute is: " +
> > >> getSession().getAttribute("test"));
> > >> in the onSubmit() method of the AjaxButton.
> > >>
> > >> If I DO NOT refresh the page before pressing the button, then it
> prints
> > >> the message with the date in the logs.
> > >>
> > >> If I do refresh the page, nothing...which I take to mean that the code
> > >> never runs.
> > >>
> > >> I'll try it in the constructor for the page.
> > >>
> > >> Chris
> > >>
> > >>
> > >> On Thu, May 14, 2015 at 4:35 PM, Martin Grigorov <
> mgrigorov@apache.org>
> > >> wrote:
> > >>
> > >>> OK, then also put the same line in some constructor that is invoked.
> > >>>
> > >>> Martin Grigorov
> > >>> Wicket Training and Consulting
> > >>> https://twitter.com/mtgrigorov
> > >>>
> > >>> On Thu, May 14, 2015 at 11:32 PM, Christopher Merrill <
> > >>> chris@webperformance.com> wrote:
> > >>>
> > >>> > I'll do that. It'll take a few minutes to deploy that back up to
> > >>> AppEngine.
> > >>> >
> > >>> > But I don't think that code will be executed - I feel pretty
> > confident
> > >>> that
> > >>> > the event listeners are not being invoked. At least, my debug
> > >>> statements in
> > >>> > the event listener do not get into the AppEngine logs.
> > >>> >
> > >>> > Chris
> > >>> >
> > >>> >
> > >>> > On Thu, May 14, 2015 at 4:23 PM, Martin Grigorov <
> > mgrigorov@apache.org
> > >>> >
> > >>> > wrote:
> > >>> >
> > >>> > > Can you try something else:
> > >>> > > in onClick() add code like: getSession.setAttribute("test", new
> > >>> Date())
> > >>> > >
> > >>> > > Martin Grigorov
> > >>> > > Wicket Training and Consulting
> > >>> > > https://twitter.com/mtgrigorov
> > >>> > >
> > >>> > > On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
> > >>> > > chris@webperformance.com> wrote:
> > >>> > >
> > >>> > > > Thanks for your help, Martin!
> > >>> > > >
> > >>> > > > I turned off page recreation by adding:
> > >>> > > >
> > >>> > > > getPageSettings().setRecreateMountedPagesAfterExpiry(false);
> > >>> > > >
> > >>> > > > to my Application.init() method.
> > >>> > > >
> > >>> > > > There is no change in the behavior, either locally or in
> > AppEngine
> > >>> --
> > >>> > > i.e.
> > >>> > > > no page expired errors.
> > >>> > > >
> > >>> > > > You can observe the behavior here:
> > >>> > > > http://1.wp-portal-staging.appspot.com/portal/pages/Test
> > >>> > > >
> > >>> > > > by visiting the page, refreshing it and then pressing a button
> > >>> (which
> > >>> > > will
> > >>> > > > do nothing if you refreshed). I posted the code for that page
> in
> > >>> > another
> > >>> > > > thread ("Model value change lost between AjaxButton.onSubmit()
> > and
> > >>> > > > form.onSubmit()"), in case that helps.
> > >>> > > >
> > >>> > > > TIA!
> > >>> > > > Chris
> > >>> > > >
> > >>> > > >
> > >>> > > >
> > >>> > > > On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <
> > >>> mgrigorov@apache.org
> > >>> > >
> > >>> > > > wrote:
> > >>> > > >
> > >>> > > > > Hi,
> > >>> > > > >
> > >>> > > > > My guess is that there is some problem with the saving of the
> > >>> page in
> > >>> > > the
> > >>> > > > > backing stores.
> > >>> > > > > Try by disabling page recreation for expired pages, see
> > >>> > IPageSettings,
> > >>> > > > > If I'm right then you should start seeing PageExpiredPage
> after
> > >>> > > clicking
> > >>> > > > > the link.
> > >>> > > > > The next step is will be to find why the pages could not be
> > >>> stored.
> > >>> > > > >
> > >>> > > > > Martin Grigorov
> > >>> > > > > Wicket Training and Consulting
> > >>> > > > > https://twitter.com/mtgrigorov
> > >>> > > > >
> > >>> > > > > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
> > >>> > > > > chris@webperformance.com> wrote:
> > >>> > > > >
> > >>> > > > > > I'm seeing problems throughout our app where refreshing the
> > >>> page
> > >>> > > causes
> > >>> > > > > > other event listeners to then malfunction. These are
> > trivially
> > >>> > simple
> > >>> > > > > > listeners, like:
> > >>> > > > > >
> > >>> > > > > > Link customer_link = new Link("org_link")
> > >>> > > > > >     {
> > >>> > > > > >     @Override
> > >>> > > > > >     public void onClick()
> > >>> > > > > >         {
> > >>> > > > > >         setResponsePage(new
> > >>> > > > > > OrganizationAdministrationPage(getPageReference(),
> > >>> > > > > > _organization_key));
> > >>> > > > > >         }
> > >>> > > > > >
> > >>> > > > > >     private static final long serialVersionUID =
> > >>> > > -6396556709778260098L;
> > >>> > > > > >     };
> > >>> > > > > >
> > >>> > > > > >
> > >>> > > > > > Instead of returning the response page, the browser
> receives
> > a
> > >>> > > forward
> > >>> > > > > > (302) back to the same page instance...which of course
> means
> > >>> that
> > >>> > the
> > >>> > > > > link
> > >>> > > > > > appears to do nothing.
> > >>> > > > > >
> > >>> > > > > > I can only reproduce this behavior when the app is deployed
> > to
> > >>> > > > AppEngine
> > >>> > > > > --
> > >>> > > > > > it works fine running on my desktop. The problems started
> > when
> > >>> we
> > >>> > > > > upgraded
> > >>> > > > > > the application to Wicket 6. I'm not implying this is a
> > Wicket
> > >>> 6
> > >>> > > > > > problem...in fact I assume we have done something that is
> > >>> causing
> > >>> > > this
> > >>> > > > > > malfunction. But since it worked under Wicket 5, I'm hoping
> > >>> someone
> > >>> > > > will
> > >>> > > > > > see a relationship between the symptoms and a change that
> we
> > >>> need
> > >>> > to
> > >>> > > > make
> > >>> > > > > > for compatibility with Wicket 6.
> > >>> > > > > >
> > >>> > > > > > Any hints or debugging ideas (since I can't step through
> the
> > >>> code
> > >>> > > > running
> > >>> > > > > > in AppEngine) would be greatly appreciated!
> > >>> > > > > >
> > >>> > > > > > Chris
> > >>> > > > > >
> > >>> > > > >
> > >>> > > >
> > >>> > >
> > >>> >
> > >>>
> > >>
> > >>
> > >
> >
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

AppEngine uses Jetty and I remembered about
https://issues.apache.org/jira/browse/WICKET-5390.
Here the reporter explains that Jetty won't update its SessionStore if it
believes the http session didn't change.
Wicket stores both o.a.w.Session and all pages rendered in the last request
as attributes in the http session.
If Jetty doesn't detect the change(s) in the http session it will not store
it and later will serve a http session with obsolete data inside.
By doing "getSession().setAttribute("blah", somethingRandom)" we try to
help Jetty realize that there is a change and make sure it saves the latest
state.
You can move this helper code in IRequestCycleListener#onEndRequest() so it
is executed for every request.
If I am correct then this should workaround the problem.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, May 15, 2015 at 12:00 AM, Christopher Merrill <
chris@webperformance.com> wrote:

> Oh, and what you probably also wanted to know: When I press refresh on the
> page, the message from the constructor does not appear in the logs again.
> Also nothing after pressing the button (which does nothing).
>
> On Thu, May 14, 2015 at 4:50 PM, Christopher Merrill <
> chris@webperformance.com> wrote:
>
> > I added the getSession().setAttribute() into the page constructor. When I
> > hit the page, I see two lines in the AppEngine logs. The first is for the
> > URL I put in the browser (/portal/pages/Test), which indicates a 302
> > response to the browser and the log entry also contains the debug message
> > that I included along with the setAttribute() line.
> >
> > The next line in the logs is for URL /portal/pages/Test?1 and is a 200
> > response with the page content.
> >
> > Does that help?
> >
> > Chris
> >
> > On Thu, May 14, 2015 at 4:42 PM, Christopher Merrill <
> > chris@webperformance.com> wrote:
> >
> >> I added that line, along with
> >>   Debug.log.out("the test attribute is: " +
> >> getSession().getAttribute("test"));
> >> in the onSubmit() method of the AjaxButton.
> >>
> >> If I DO NOT refresh the page before pressing the button, then it prints
> >> the message with the date in the logs.
> >>
> >> If I do refresh the page, nothing...which I take to mean that the code
> >> never runs.
> >>
> >> I'll try it in the constructor for the page.
> >>
> >> Chris
> >>
> >>
> >> On Thu, May 14, 2015 at 4:35 PM, Martin Grigorov <mg...@apache.org>
> >> wrote:
> >>
> >>> OK, then also put the same line in some constructor that is invoked.
> >>>
> >>> Martin Grigorov
> >>> Wicket Training and Consulting
> >>> https://twitter.com/mtgrigorov
> >>>
> >>> On Thu, May 14, 2015 at 11:32 PM, Christopher Merrill <
> >>> chris@webperformance.com> wrote:
> >>>
> >>> > I'll do that. It'll take a few minutes to deploy that back up to
> >>> AppEngine.
> >>> >
> >>> > But I don't think that code will be executed - I feel pretty
> confident
> >>> that
> >>> > the event listeners are not being invoked. At least, my debug
> >>> statements in
> >>> > the event listener do not get into the AppEngine logs.
> >>> >
> >>> > Chris
> >>> >
> >>> >
> >>> > On Thu, May 14, 2015 at 4:23 PM, Martin Grigorov <
> mgrigorov@apache.org
> >>> >
> >>> > wrote:
> >>> >
> >>> > > Can you try something else:
> >>> > > in onClick() add code like: getSession.setAttribute("test", new
> >>> Date())
> >>> > >
> >>> > > Martin Grigorov
> >>> > > Wicket Training and Consulting
> >>> > > https://twitter.com/mtgrigorov
> >>> > >
> >>> > > On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
> >>> > > chris@webperformance.com> wrote:
> >>> > >
> >>> > > > Thanks for your help, Martin!
> >>> > > >
> >>> > > > I turned off page recreation by adding:
> >>> > > >
> >>> > > > getPageSettings().setRecreateMountedPagesAfterExpiry(false);
> >>> > > >
> >>> > > > to my Application.init() method.
> >>> > > >
> >>> > > > There is no change in the behavior, either locally or in
> AppEngine
> >>> --
> >>> > > i.e.
> >>> > > > no page expired errors.
> >>> > > >
> >>> > > > You can observe the behavior here:
> >>> > > > http://1.wp-portal-staging.appspot.com/portal/pages/Test
> >>> > > >
> >>> > > > by visiting the page, refreshing it and then pressing a button
> >>> (which
> >>> > > will
> >>> > > > do nothing if you refreshed). I posted the code for that page in
> >>> > another
> >>> > > > thread ("Model value change lost between AjaxButton.onSubmit()
> and
> >>> > > > form.onSubmit()"), in case that helps.
> >>> > > >
> >>> > > > TIA!
> >>> > > > Chris
> >>> > > >
> >>> > > >
> >>> > > >
> >>> > > > On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <
> >>> mgrigorov@apache.org
> >>> > >
> >>> > > > wrote:
> >>> > > >
> >>> > > > > Hi,
> >>> > > > >
> >>> > > > > My guess is that there is some problem with the saving of the
> >>> page in
> >>> > > the
> >>> > > > > backing stores.
> >>> > > > > Try by disabling page recreation for expired pages, see
> >>> > IPageSettings,
> >>> > > > > If I'm right then you should start seeing PageExpiredPage after
> >>> > > clicking
> >>> > > > > the link.
> >>> > > > > The next step is will be to find why the pages could not be
> >>> stored.
> >>> > > > >
> >>> > > > > Martin Grigorov
> >>> > > > > Wicket Training and Consulting
> >>> > > > > https://twitter.com/mtgrigorov
> >>> > > > >
> >>> > > > > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
> >>> > > > > chris@webperformance.com> wrote:
> >>> > > > >
> >>> > > > > > I'm seeing problems throughout our app where refreshing the
> >>> page
> >>> > > causes
> >>> > > > > > other event listeners to then malfunction. These are
> trivially
> >>> > simple
> >>> > > > > > listeners, like:
> >>> > > > > >
> >>> > > > > > Link customer_link = new Link("org_link")
> >>> > > > > >     {
> >>> > > > > >     @Override
> >>> > > > > >     public void onClick()
> >>> > > > > >         {
> >>> > > > > >         setResponsePage(new
> >>> > > > > > OrganizationAdministrationPage(getPageReference(),
> >>> > > > > > _organization_key));
> >>> > > > > >         }
> >>> > > > > >
> >>> > > > > >     private static final long serialVersionUID =
> >>> > > -6396556709778260098L;
> >>> > > > > >     };
> >>> > > > > >
> >>> > > > > >
> >>> > > > > > Instead of returning the response page, the browser receives
> a
> >>> > > forward
> >>> > > > > > (302) back to the same page instance...which of course means
> >>> that
> >>> > the
> >>> > > > > link
> >>> > > > > > appears to do nothing.
> >>> > > > > >
> >>> > > > > > I can only reproduce this behavior when the app is deployed
> to
> >>> > > > AppEngine
> >>> > > > > --
> >>> > > > > > it works fine running on my desktop. The problems started
> when
> >>> we
> >>> > > > > upgraded
> >>> > > > > > the application to Wicket 6. I'm not implying this is a
> Wicket
> >>> 6
> >>> > > > > > problem...in fact I assume we have done something that is
> >>> causing
> >>> > > this
> >>> > > > > > malfunction. But since it worked under Wicket 5, I'm hoping
> >>> someone
> >>> > > > will
> >>> > > > > > see a relationship between the symptoms and a change that we
> >>> need
> >>> > to
> >>> > > > make
> >>> > > > > > for compatibility with Wicket 6.
> >>> > > > > >
> >>> > > > > > Any hints or debugging ideas (since I can't step through the
> >>> code
> >>> > > > running
> >>> > > > > > in AppEngine) would be greatly appreciated!
> >>> > > > > >
> >>> > > > > > Chris
> >>> > > > > >
> >>> > > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> >>
> >>
> >
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Christopher Merrill <ch...@webperformance.com>.
Oh, and what you probably also wanted to know: When I press refresh on the
page, the message from the constructor does not appear in the logs again.
Also nothing after pressing the button (which does nothing).

On Thu, May 14, 2015 at 4:50 PM, Christopher Merrill <
chris@webperformance.com> wrote:

> I added the getSession().setAttribute() into the page constructor. When I
> hit the page, I see two lines in the AppEngine logs. The first is for the
> URL I put in the browser (/portal/pages/Test), which indicates a 302
> response to the browser and the log entry also contains the debug message
> that I included along with the setAttribute() line.
>
> The next line in the logs is for URL /portal/pages/Test?1 and is a 200
> response with the page content.
>
> Does that help?
>
> Chris
>
> On Thu, May 14, 2015 at 4:42 PM, Christopher Merrill <
> chris@webperformance.com> wrote:
>
>> I added that line, along with
>>   Debug.log.out("the test attribute is: " +
>> getSession().getAttribute("test"));
>> in the onSubmit() method of the AjaxButton.
>>
>> If I DO NOT refresh the page before pressing the button, then it prints
>> the message with the date in the logs.
>>
>> If I do refresh the page, nothing...which I take to mean that the code
>> never runs.
>>
>> I'll try it in the constructor for the page.
>>
>> Chris
>>
>>
>> On Thu, May 14, 2015 at 4:35 PM, Martin Grigorov <mg...@apache.org>
>> wrote:
>>
>>> OK, then also put the same line in some constructor that is invoked.
>>>
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>>
>>> On Thu, May 14, 2015 at 11:32 PM, Christopher Merrill <
>>> chris@webperformance.com> wrote:
>>>
>>> > I'll do that. It'll take a few minutes to deploy that back up to
>>> AppEngine.
>>> >
>>> > But I don't think that code will be executed - I feel pretty confident
>>> that
>>> > the event listeners are not being invoked. At least, my debug
>>> statements in
>>> > the event listener do not get into the AppEngine logs.
>>> >
>>> > Chris
>>> >
>>> >
>>> > On Thu, May 14, 2015 at 4:23 PM, Martin Grigorov <mgrigorov@apache.org
>>> >
>>> > wrote:
>>> >
>>> > > Can you try something else:
>>> > > in onClick() add code like: getSession.setAttribute("test", new
>>> Date())
>>> > >
>>> > > Martin Grigorov
>>> > > Wicket Training and Consulting
>>> > > https://twitter.com/mtgrigorov
>>> > >
>>> > > On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
>>> > > chris@webperformance.com> wrote:
>>> > >
>>> > > > Thanks for your help, Martin!
>>> > > >
>>> > > > I turned off page recreation by adding:
>>> > > >
>>> > > > getPageSettings().setRecreateMountedPagesAfterExpiry(false);
>>> > > >
>>> > > > to my Application.init() method.
>>> > > >
>>> > > > There is no change in the behavior, either locally or in AppEngine
>>> --
>>> > > i.e.
>>> > > > no page expired errors.
>>> > > >
>>> > > > You can observe the behavior here:
>>> > > > http://1.wp-portal-staging.appspot.com/portal/pages/Test
>>> > > >
>>> > > > by visiting the page, refreshing it and then pressing a button
>>> (which
>>> > > will
>>> > > > do nothing if you refreshed). I posted the code for that page in
>>> > another
>>> > > > thread ("Model value change lost between AjaxButton.onSubmit() and
>>> > > > form.onSubmit()"), in case that helps.
>>> > > >
>>> > > > TIA!
>>> > > > Chris
>>> > > >
>>> > > >
>>> > > >
>>> > > > On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <
>>> mgrigorov@apache.org
>>> > >
>>> > > > wrote:
>>> > > >
>>> > > > > Hi,
>>> > > > >
>>> > > > > My guess is that there is some problem with the saving of the
>>> page in
>>> > > the
>>> > > > > backing stores.
>>> > > > > Try by disabling page recreation for expired pages, see
>>> > IPageSettings,
>>> > > > > If I'm right then you should start seeing PageExpiredPage after
>>> > > clicking
>>> > > > > the link.
>>> > > > > The next step is will be to find why the pages could not be
>>> stored.
>>> > > > >
>>> > > > > Martin Grigorov
>>> > > > > Wicket Training and Consulting
>>> > > > > https://twitter.com/mtgrigorov
>>> > > > >
>>> > > > > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
>>> > > > > chris@webperformance.com> wrote:
>>> > > > >
>>> > > > > > I'm seeing problems throughout our app where refreshing the
>>> page
>>> > > causes
>>> > > > > > other event listeners to then malfunction. These are trivially
>>> > simple
>>> > > > > > listeners, like:
>>> > > > > >
>>> > > > > > Link customer_link = new Link("org_link")
>>> > > > > >     {
>>> > > > > >     @Override
>>> > > > > >     public void onClick()
>>> > > > > >         {
>>> > > > > >         setResponsePage(new
>>> > > > > > OrganizationAdministrationPage(getPageReference(),
>>> > > > > > _organization_key));
>>> > > > > >         }
>>> > > > > >
>>> > > > > >     private static final long serialVersionUID =
>>> > > -6396556709778260098L;
>>> > > > > >     };
>>> > > > > >
>>> > > > > >
>>> > > > > > Instead of returning the response page, the browser receives a
>>> > > forward
>>> > > > > > (302) back to the same page instance...which of course means
>>> that
>>> > the
>>> > > > > link
>>> > > > > > appears to do nothing.
>>> > > > > >
>>> > > > > > I can only reproduce this behavior when the app is deployed to
>>> > > > AppEngine
>>> > > > > --
>>> > > > > > it works fine running on my desktop. The problems started when
>>> we
>>> > > > > upgraded
>>> > > > > > the application to Wicket 6. I'm not implying this is a Wicket
>>> 6
>>> > > > > > problem...in fact I assume we have done something that is
>>> causing
>>> > > this
>>> > > > > > malfunction. But since it worked under Wicket 5, I'm hoping
>>> someone
>>> > > > will
>>> > > > > > see a relationship between the symptoms and a change that we
>>> need
>>> > to
>>> > > > make
>>> > > > > > for compatibility with Wicket 6.
>>> > > > > >
>>> > > > > > Any hints or debugging ideas (since I can't step through the
>>> code
>>> > > > running
>>> > > > > > in AppEngine) would be greatly appreciated!
>>> > > > > >
>>> > > > > > Chris
>>> > > > > >
>>> > > > >
>>> > > >
>>> > >
>>> >
>>>
>>
>>
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Christopher Merrill <ch...@webperformance.com>.
You're right!!!  I didn't even look at that - I only looked to see if the
log messages were there. <embarrassed>

On Thu, May 14, 2015 at 5:00 PM, Martin Grigorov <mg...@apache.org>
wrote:

> The url seems to work now!
> Clicking deactivate sets the property to null.
> Please confirm that it works as expected.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, May 14, 2015 at 11:50 PM, Christopher Merrill <
> chris@webperformance.com> wrote:
>
> > I added the getSession().setAttribute() into the page constructor. When I
> > hit the page, I see two lines in the AppEngine logs. The first is for the
> > URL I put in the browser (/portal/pages/Test), which indicates a 302
> > response to the browser and the log entry also contains the debug message
> > that I included along with the setAttribute() line.
> >
> > The next line in the logs is for URL /portal/pages/Test?1 and is a 200
> > response with the page content.
> >
> > Does that help?
> >
> > Chris
> >
> > On Thu, May 14, 2015 at 4:42 PM, Christopher Merrill <
> > chris@webperformance.com> wrote:
> >
> > > I added that line, along with
> > >   Debug.log.out("the test attribute is: " +
> > > getSession().getAttribute("test"));
> > > in the onSubmit() method of the AjaxButton.
> > >
> > > If I DO NOT refresh the page before pressing the button, then it prints
> > > the message with the date in the logs.
> > >
> > > If I do refresh the page, nothing...which I take to mean that the code
> > > never runs.
> > >
> > > I'll try it in the constructor for the page.
> > >
> > > Chris
> > >
> > >
> > > On Thu, May 14, 2015 at 4:35 PM, Martin Grigorov <mgrigorov@apache.org
> >
> > > wrote:
> > >
> > >> OK, then also put the same line in some constructor that is invoked.
> > >>
> > >> Martin Grigorov
> > >> Wicket Training and Consulting
> > >> https://twitter.com/mtgrigorov
> > >>
> > >> On Thu, May 14, 2015 at 11:32 PM, Christopher Merrill <
> > >> chris@webperformance.com> wrote:
> > >>
> > >> > I'll do that. It'll take a few minutes to deploy that back up to
> > >> AppEngine.
> > >> >
> > >> > But I don't think that code will be executed - I feel pretty
> confident
> > >> that
> > >> > the event listeners are not being invoked. At least, my debug
> > >> statements in
> > >> > the event listener do not get into the AppEngine logs.
> > >> >
> > >> > Chris
> > >> >
> > >> >
> > >> > On Thu, May 14, 2015 at 4:23 PM, Martin Grigorov <
> > mgrigorov@apache.org>
> > >> > wrote:
> > >> >
> > >> > > Can you try something else:
> > >> > > in onClick() add code like: getSession.setAttribute("test", new
> > >> Date())
> > >> > >
> > >> > > Martin Grigorov
> > >> > > Wicket Training and Consulting
> > >> > > https://twitter.com/mtgrigorov
> > >> > >
> > >> > > On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
> > >> > > chris@webperformance.com> wrote:
> > >> > >
> > >> > > > Thanks for your help, Martin!
> > >> > > >
> > >> > > > I turned off page recreation by adding:
> > >> > > >
> > >> > > > getPageSettings().setRecreateMountedPagesAfterExpiry(false);
> > >> > > >
> > >> > > > to my Application.init() method.
> > >> > > >
> > >> > > > There is no change in the behavior, either locally or in
> AppEngine
> > >> --
> > >> > > i.e.
> > >> > > > no page expired errors.
> > >> > > >
> > >> > > > You can observe the behavior here:
> > >> > > > http://1.wp-portal-staging.appspot.com/portal/pages/Test
> > >> > > >
> > >> > > > by visiting the page, refreshing it and then pressing a button
> > >> (which
> > >> > > will
> > >> > > > do nothing if you refreshed). I posted the code for that page in
> > >> > another
> > >> > > > thread ("Model value change lost between AjaxButton.onSubmit()
> and
> > >> > > > form.onSubmit()"), in case that helps.
> > >> > > >
> > >> > > > TIA!
> > >> > > > Chris
> > >> > > >
> > >> > > >
> > >> > > >
> > >> > > > On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <
> > >> mgrigorov@apache.org
> > >> > >
> > >> > > > wrote:
> > >> > > >
> > >> > > > > Hi,
> > >> > > > >
> > >> > > > > My guess is that there is some problem with the saving of the
> > >> page in
> > >> > > the
> > >> > > > > backing stores.
> > >> > > > > Try by disabling page recreation for expired pages, see
> > >> > IPageSettings,
> > >> > > > > If I'm right then you should start seeing PageExpiredPage
> after
> > >> > > clicking
> > >> > > > > the link.
> > >> > > > > The next step is will be to find why the pages could not be
> > >> stored.
> > >> > > > >
> > >> > > > > Martin Grigorov
> > >> > > > > Wicket Training and Consulting
> > >> > > > > https://twitter.com/mtgrigorov
> > >> > > > >
> > >> > > > > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
> > >> > > > > chris@webperformance.com> wrote:
> > >> > > > >
> > >> > > > > > I'm seeing problems throughout our app where refreshing the
> > page
> > >> > > causes
> > >> > > > > > other event listeners to then malfunction. These are
> trivially
> > >> > simple
> > >> > > > > > listeners, like:
> > >> > > > > >
> > >> > > > > > Link customer_link = new Link("org_link")
> > >> > > > > >     {
> > >> > > > > >     @Override
> > >> > > > > >     public void onClick()
> > >> > > > > >         {
> > >> > > > > >         setResponsePage(new
> > >> > > > > > OrganizationAdministrationPage(getPageReference(),
> > >> > > > > > _organization_key));
> > >> > > > > >         }
> > >> > > > > >
> > >> > > > > >     private static final long serialVersionUID =
> > >> > > -6396556709778260098L;
> > >> > > > > >     };
> > >> > > > > >
> > >> > > > > >
> > >> > > > > > Instead of returning the response page, the browser
> receives a
> > >> > > forward
> > >> > > > > > (302) back to the same page instance...which of course means
> > >> that
> > >> > the
> > >> > > > > link
> > >> > > > > > appears to do nothing.
> > >> > > > > >
> > >> > > > > > I can only reproduce this behavior when the app is deployed
> to
> > >> > > > AppEngine
> > >> > > > > --
> > >> > > > > > it works fine running on my desktop. The problems started
> when
> > >> we
> > >> > > > > upgraded
> > >> > > > > > the application to Wicket 6. I'm not implying this is a
> > Wicket 6
> > >> > > > > > problem...in fact I assume we have done something that is
> > >> causing
> > >> > > this
> > >> > > > > > malfunction. But since it worked under Wicket 5, I'm hoping
> > >> someone
> > >> > > > will
> > >> > > > > > see a relationship between the symptoms and a change that we
> > >> need
> > >> > to
> > >> > > > make
> > >> > > > > > for compatibility with Wicket 6.
> > >> > > > > >
> > >> > > > > > Any hints or debugging ideas (since I can't step through the
> > >> code
> > >> > > > running
> > >> > > > > > in AppEngine) would be greatly appreciated!
> > >> > > > > >
> > >> > > > > > Chris
> > >> > > > > >
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> > >
> > >
> >
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Martin Grigorov <mg...@apache.org>.
The url seems to work now!
Clicking deactivate sets the property to null.
Please confirm that it works as expected.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, May 14, 2015 at 11:50 PM, Christopher Merrill <
chris@webperformance.com> wrote:

> I added the getSession().setAttribute() into the page constructor. When I
> hit the page, I see two lines in the AppEngine logs. The first is for the
> URL I put in the browser (/portal/pages/Test), which indicates a 302
> response to the browser and the log entry also contains the debug message
> that I included along with the setAttribute() line.
>
> The next line in the logs is for URL /portal/pages/Test?1 and is a 200
> response with the page content.
>
> Does that help?
>
> Chris
>
> On Thu, May 14, 2015 at 4:42 PM, Christopher Merrill <
> chris@webperformance.com> wrote:
>
> > I added that line, along with
> >   Debug.log.out("the test attribute is: " +
> > getSession().getAttribute("test"));
> > in the onSubmit() method of the AjaxButton.
> >
> > If I DO NOT refresh the page before pressing the button, then it prints
> > the message with the date in the logs.
> >
> > If I do refresh the page, nothing...which I take to mean that the code
> > never runs.
> >
> > I'll try it in the constructor for the page.
> >
> > Chris
> >
> >
> > On Thu, May 14, 2015 at 4:35 PM, Martin Grigorov <mg...@apache.org>
> > wrote:
> >
> >> OK, then also put the same line in some constructor that is invoked.
> >>
> >> Martin Grigorov
> >> Wicket Training and Consulting
> >> https://twitter.com/mtgrigorov
> >>
> >> On Thu, May 14, 2015 at 11:32 PM, Christopher Merrill <
> >> chris@webperformance.com> wrote:
> >>
> >> > I'll do that. It'll take a few minutes to deploy that back up to
> >> AppEngine.
> >> >
> >> > But I don't think that code will be executed - I feel pretty confident
> >> that
> >> > the event listeners are not being invoked. At least, my debug
> >> statements in
> >> > the event listener do not get into the AppEngine logs.
> >> >
> >> > Chris
> >> >
> >> >
> >> > On Thu, May 14, 2015 at 4:23 PM, Martin Grigorov <
> mgrigorov@apache.org>
> >> > wrote:
> >> >
> >> > > Can you try something else:
> >> > > in onClick() add code like: getSession.setAttribute("test", new
> >> Date())
> >> > >
> >> > > Martin Grigorov
> >> > > Wicket Training and Consulting
> >> > > https://twitter.com/mtgrigorov
> >> > >
> >> > > On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
> >> > > chris@webperformance.com> wrote:
> >> > >
> >> > > > Thanks for your help, Martin!
> >> > > >
> >> > > > I turned off page recreation by adding:
> >> > > >
> >> > > > getPageSettings().setRecreateMountedPagesAfterExpiry(false);
> >> > > >
> >> > > > to my Application.init() method.
> >> > > >
> >> > > > There is no change in the behavior, either locally or in AppEngine
> >> --
> >> > > i.e.
> >> > > > no page expired errors.
> >> > > >
> >> > > > You can observe the behavior here:
> >> > > > http://1.wp-portal-staging.appspot.com/portal/pages/Test
> >> > > >
> >> > > > by visiting the page, refreshing it and then pressing a button
> >> (which
> >> > > will
> >> > > > do nothing if you refreshed). I posted the code for that page in
> >> > another
> >> > > > thread ("Model value change lost between AjaxButton.onSubmit() and
> >> > > > form.onSubmit()"), in case that helps.
> >> > > >
> >> > > > TIA!
> >> > > > Chris
> >> > > >
> >> > > >
> >> > > >
> >> > > > On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <
> >> mgrigorov@apache.org
> >> > >
> >> > > > wrote:
> >> > > >
> >> > > > > Hi,
> >> > > > >
> >> > > > > My guess is that there is some problem with the saving of the
> >> page in
> >> > > the
> >> > > > > backing stores.
> >> > > > > Try by disabling page recreation for expired pages, see
> >> > IPageSettings,
> >> > > > > If I'm right then you should start seeing PageExpiredPage after
> >> > > clicking
> >> > > > > the link.
> >> > > > > The next step is will be to find why the pages could not be
> >> stored.
> >> > > > >
> >> > > > > Martin Grigorov
> >> > > > > Wicket Training and Consulting
> >> > > > > https://twitter.com/mtgrigorov
> >> > > > >
> >> > > > > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
> >> > > > > chris@webperformance.com> wrote:
> >> > > > >
> >> > > > > > I'm seeing problems throughout our app where refreshing the
> page
> >> > > causes
> >> > > > > > other event listeners to then malfunction. These are trivially
> >> > simple
> >> > > > > > listeners, like:
> >> > > > > >
> >> > > > > > Link customer_link = new Link("org_link")
> >> > > > > >     {
> >> > > > > >     @Override
> >> > > > > >     public void onClick()
> >> > > > > >         {
> >> > > > > >         setResponsePage(new
> >> > > > > > OrganizationAdministrationPage(getPageReference(),
> >> > > > > > _organization_key));
> >> > > > > >         }
> >> > > > > >
> >> > > > > >     private static final long serialVersionUID =
> >> > > -6396556709778260098L;
> >> > > > > >     };
> >> > > > > >
> >> > > > > >
> >> > > > > > Instead of returning the response page, the browser receives a
> >> > > forward
> >> > > > > > (302) back to the same page instance...which of course means
> >> that
> >> > the
> >> > > > > link
> >> > > > > > appears to do nothing.
> >> > > > > >
> >> > > > > > I can only reproduce this behavior when the app is deployed to
> >> > > > AppEngine
> >> > > > > --
> >> > > > > > it works fine running on my desktop. The problems started when
> >> we
> >> > > > > upgraded
> >> > > > > > the application to Wicket 6. I'm not implying this is a
> Wicket 6
> >> > > > > > problem...in fact I assume we have done something that is
> >> causing
> >> > > this
> >> > > > > > malfunction. But since it worked under Wicket 5, I'm hoping
> >> someone
> >> > > > will
> >> > > > > > see a relationship between the symptoms and a change that we
> >> need
> >> > to
> >> > > > make
> >> > > > > > for compatibility with Wicket 6.
> >> > > > > >
> >> > > > > > Any hints or debugging ideas (since I can't step through the
> >> code
> >> > > > running
> >> > > > > > in AppEngine) would be greatly appreciated!
> >> > > > > >
> >> > > > > > Chris
> >> > > > > >
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> >
> >
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Christopher Merrill <ch...@webperformance.com>.
I added the getSession().setAttribute() into the page constructor. When I
hit the page, I see two lines in the AppEngine logs. The first is for the
URL I put in the browser (/portal/pages/Test), which indicates a 302
response to the browser and the log entry also contains the debug message
that I included along with the setAttribute() line.

The next line in the logs is for URL /portal/pages/Test?1 and is a 200
response with the page content.

Does that help?

Chris

On Thu, May 14, 2015 at 4:42 PM, Christopher Merrill <
chris@webperformance.com> wrote:

> I added that line, along with
>   Debug.log.out("the test attribute is: " +
> getSession().getAttribute("test"));
> in the onSubmit() method of the AjaxButton.
>
> If I DO NOT refresh the page before pressing the button, then it prints
> the message with the date in the logs.
>
> If I do refresh the page, nothing...which I take to mean that the code
> never runs.
>
> I'll try it in the constructor for the page.
>
> Chris
>
>
> On Thu, May 14, 2015 at 4:35 PM, Martin Grigorov <mg...@apache.org>
> wrote:
>
>> OK, then also put the same line in some constructor that is invoked.
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Thu, May 14, 2015 at 11:32 PM, Christopher Merrill <
>> chris@webperformance.com> wrote:
>>
>> > I'll do that. It'll take a few minutes to deploy that back up to
>> AppEngine.
>> >
>> > But I don't think that code will be executed - I feel pretty confident
>> that
>> > the event listeners are not being invoked. At least, my debug
>> statements in
>> > the event listener do not get into the AppEngine logs.
>> >
>> > Chris
>> >
>> >
>> > On Thu, May 14, 2015 at 4:23 PM, Martin Grigorov <mg...@apache.org>
>> > wrote:
>> >
>> > > Can you try something else:
>> > > in onClick() add code like: getSession.setAttribute("test", new
>> Date())
>> > >
>> > > Martin Grigorov
>> > > Wicket Training and Consulting
>> > > https://twitter.com/mtgrigorov
>> > >
>> > > On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
>> > > chris@webperformance.com> wrote:
>> > >
>> > > > Thanks for your help, Martin!
>> > > >
>> > > > I turned off page recreation by adding:
>> > > >
>> > > > getPageSettings().setRecreateMountedPagesAfterExpiry(false);
>> > > >
>> > > > to my Application.init() method.
>> > > >
>> > > > There is no change in the behavior, either locally or in AppEngine
>> --
>> > > i.e.
>> > > > no page expired errors.
>> > > >
>> > > > You can observe the behavior here:
>> > > > http://1.wp-portal-staging.appspot.com/portal/pages/Test
>> > > >
>> > > > by visiting the page, refreshing it and then pressing a button
>> (which
>> > > will
>> > > > do nothing if you refreshed). I posted the code for that page in
>> > another
>> > > > thread ("Model value change lost between AjaxButton.onSubmit() and
>> > > > form.onSubmit()"), in case that helps.
>> > > >
>> > > > TIA!
>> > > > Chris
>> > > >
>> > > >
>> > > >
>> > > > On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <
>> mgrigorov@apache.org
>> > >
>> > > > wrote:
>> > > >
>> > > > > Hi,
>> > > > >
>> > > > > My guess is that there is some problem with the saving of the
>> page in
>> > > the
>> > > > > backing stores.
>> > > > > Try by disabling page recreation for expired pages, see
>> > IPageSettings,
>> > > > > If I'm right then you should start seeing PageExpiredPage after
>> > > clicking
>> > > > > the link.
>> > > > > The next step is will be to find why the pages could not be
>> stored.
>> > > > >
>> > > > > Martin Grigorov
>> > > > > Wicket Training and Consulting
>> > > > > https://twitter.com/mtgrigorov
>> > > > >
>> > > > > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
>> > > > > chris@webperformance.com> wrote:
>> > > > >
>> > > > > > I'm seeing problems throughout our app where refreshing the page
>> > > causes
>> > > > > > other event listeners to then malfunction. These are trivially
>> > simple
>> > > > > > listeners, like:
>> > > > > >
>> > > > > > Link customer_link = new Link("org_link")
>> > > > > >     {
>> > > > > >     @Override
>> > > > > >     public void onClick()
>> > > > > >         {
>> > > > > >         setResponsePage(new
>> > > > > > OrganizationAdministrationPage(getPageReference(),
>> > > > > > _organization_key));
>> > > > > >         }
>> > > > > >
>> > > > > >     private static final long serialVersionUID =
>> > > -6396556709778260098L;
>> > > > > >     };
>> > > > > >
>> > > > > >
>> > > > > > Instead of returning the response page, the browser receives a
>> > > forward
>> > > > > > (302) back to the same page instance...which of course means
>> that
>> > the
>> > > > > link
>> > > > > > appears to do nothing.
>> > > > > >
>> > > > > > I can only reproduce this behavior when the app is deployed to
>> > > > AppEngine
>> > > > > --
>> > > > > > it works fine running on my desktop. The problems started when
>> we
>> > > > > upgraded
>> > > > > > the application to Wicket 6. I'm not implying this is a Wicket 6
>> > > > > > problem...in fact I assume we have done something that is
>> causing
>> > > this
>> > > > > > malfunction. But since it worked under Wicket 5, I'm hoping
>> someone
>> > > > will
>> > > > > > see a relationship between the symptoms and a change that we
>> need
>> > to
>> > > > make
>> > > > > > for compatibility with Wicket 6.
>> > > > > >
>> > > > > > Any hints or debugging ideas (since I can't step through the
>> code
>> > > > running
>> > > > > > in AppEngine) would be greatly appreciated!
>> > > > > >
>> > > > > > Chris
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>>
>
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Christopher Merrill <ch...@webperformance.com>.
I added that line, along with
  Debug.log.out("the test attribute is: " +
getSession().getAttribute("test"));
in the onSubmit() method of the AjaxButton.

If I DO NOT refresh the page before pressing the button, then it prints the
message with the date in the logs.

If I do refresh the page, nothing...which I take to mean that the code
never runs.

I'll try it in the constructor for the page.

Chris


On Thu, May 14, 2015 at 4:35 PM, Martin Grigorov <mg...@apache.org>
wrote:

> OK, then also put the same line in some constructor that is invoked.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, May 14, 2015 at 11:32 PM, Christopher Merrill <
> chris@webperformance.com> wrote:
>
> > I'll do that. It'll take a few minutes to deploy that back up to
> AppEngine.
> >
> > But I don't think that code will be executed - I feel pretty confident
> that
> > the event listeners are not being invoked. At least, my debug statements
> in
> > the event listener do not get into the AppEngine logs.
> >
> > Chris
> >
> >
> > On Thu, May 14, 2015 at 4:23 PM, Martin Grigorov <mg...@apache.org>
> > wrote:
> >
> > > Can you try something else:
> > > in onClick() add code like: getSession.setAttribute("test", new Date())
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
> > > chris@webperformance.com> wrote:
> > >
> > > > Thanks for your help, Martin!
> > > >
> > > > I turned off page recreation by adding:
> > > >
> > > > getPageSettings().setRecreateMountedPagesAfterExpiry(false);
> > > >
> > > > to my Application.init() method.
> > > >
> > > > There is no change in the behavior, either locally or in AppEngine --
> > > i.e.
> > > > no page expired errors.
> > > >
> > > > You can observe the behavior here:
> > > > http://1.wp-portal-staging.appspot.com/portal/pages/Test
> > > >
> > > > by visiting the page, refreshing it and then pressing a button (which
> > > will
> > > > do nothing if you refreshed). I posted the code for that page in
> > another
> > > > thread ("Model value change lost between AjaxButton.onSubmit() and
> > > > form.onSubmit()"), in case that helps.
> > > >
> > > > TIA!
> > > > Chris
> > > >
> > > >
> > > >
> > > > On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <
> mgrigorov@apache.org
> > >
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > My guess is that there is some problem with the saving of the page
> in
> > > the
> > > > > backing stores.
> > > > > Try by disabling page recreation for expired pages, see
> > IPageSettings,
> > > > > If I'm right then you should start seeing PageExpiredPage after
> > > clicking
> > > > > the link.
> > > > > The next step is will be to find why the pages could not be stored.
> > > > >
> > > > > Martin Grigorov
> > > > > Wicket Training and Consulting
> > > > > https://twitter.com/mtgrigorov
> > > > >
> > > > > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
> > > > > chris@webperformance.com> wrote:
> > > > >
> > > > > > I'm seeing problems throughout our app where refreshing the page
> > > causes
> > > > > > other event listeners to then malfunction. These are trivially
> > simple
> > > > > > listeners, like:
> > > > > >
> > > > > > Link customer_link = new Link("org_link")
> > > > > >     {
> > > > > >     @Override
> > > > > >     public void onClick()
> > > > > >         {
> > > > > >         setResponsePage(new
> > > > > > OrganizationAdministrationPage(getPageReference(),
> > > > > > _organization_key));
> > > > > >         }
> > > > > >
> > > > > >     private static final long serialVersionUID =
> > > -6396556709778260098L;
> > > > > >     };
> > > > > >
> > > > > >
> > > > > > Instead of returning the response page, the browser receives a
> > > forward
> > > > > > (302) back to the same page instance...which of course means that
> > the
> > > > > link
> > > > > > appears to do nothing.
> > > > > >
> > > > > > I can only reproduce this behavior when the app is deployed to
> > > > AppEngine
> > > > > --
> > > > > > it works fine running on my desktop. The problems started when we
> > > > > upgraded
> > > > > > the application to Wicket 6. I'm not implying this is a Wicket 6
> > > > > > problem...in fact I assume we have done something that is causing
> > > this
> > > > > > malfunction. But since it worked under Wicket 5, I'm hoping
> someone
> > > > will
> > > > > > see a relationship between the symptoms and a change that we need
> > to
> > > > make
> > > > > > for compatibility with Wicket 6.
> > > > > >
> > > > > > Any hints or debugging ideas (since I can't step through the code
> > > > running
> > > > > > in AppEngine) would be greatly appreciated!
> > > > > >
> > > > > > Chris
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Martin Grigorov <mg...@apache.org>.
OK, then also put the same line in some constructor that is invoked.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, May 14, 2015 at 11:32 PM, Christopher Merrill <
chris@webperformance.com> wrote:

> I'll do that. It'll take a few minutes to deploy that back up to AppEngine.
>
> But I don't think that code will be executed - I feel pretty confident that
> the event listeners are not being invoked. At least, my debug statements in
> the event listener do not get into the AppEngine logs.
>
> Chris
>
>
> On Thu, May 14, 2015 at 4:23 PM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Can you try something else:
> > in onClick() add code like: getSession.setAttribute("test", new Date())
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
> > chris@webperformance.com> wrote:
> >
> > > Thanks for your help, Martin!
> > >
> > > I turned off page recreation by adding:
> > >
> > > getPageSettings().setRecreateMountedPagesAfterExpiry(false);
> > >
> > > to my Application.init() method.
> > >
> > > There is no change in the behavior, either locally or in AppEngine --
> > i.e.
> > > no page expired errors.
> > >
> > > You can observe the behavior here:
> > > http://1.wp-portal-staging.appspot.com/portal/pages/Test
> > >
> > > by visiting the page, refreshing it and then pressing a button (which
> > will
> > > do nothing if you refreshed). I posted the code for that page in
> another
> > > thread ("Model value change lost between AjaxButton.onSubmit() and
> > > form.onSubmit()"), in case that helps.
> > >
> > > TIA!
> > > Chris
> > >
> > >
> > >
> > > On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <mgrigorov@apache.org
> >
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > My guess is that there is some problem with the saving of the page in
> > the
> > > > backing stores.
> > > > Try by disabling page recreation for expired pages, see
> IPageSettings,
> > > > If I'm right then you should start seeing PageExpiredPage after
> > clicking
> > > > the link.
> > > > The next step is will be to find why the pages could not be stored.
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
> > > > chris@webperformance.com> wrote:
> > > >
> > > > > I'm seeing problems throughout our app where refreshing the page
> > causes
> > > > > other event listeners to then malfunction. These are trivially
> simple
> > > > > listeners, like:
> > > > >
> > > > > Link customer_link = new Link("org_link")
> > > > >     {
> > > > >     @Override
> > > > >     public void onClick()
> > > > >         {
> > > > >         setResponsePage(new
> > > > > OrganizationAdministrationPage(getPageReference(),
> > > > > _organization_key));
> > > > >         }
> > > > >
> > > > >     private static final long serialVersionUID =
> > -6396556709778260098L;
> > > > >     };
> > > > >
> > > > >
> > > > > Instead of returning the response page, the browser receives a
> > forward
> > > > > (302) back to the same page instance...which of course means that
> the
> > > > link
> > > > > appears to do nothing.
> > > > >
> > > > > I can only reproduce this behavior when the app is deployed to
> > > AppEngine
> > > > --
> > > > > it works fine running on my desktop. The problems started when we
> > > > upgraded
> > > > > the application to Wicket 6. I'm not implying this is a Wicket 6
> > > > > problem...in fact I assume we have done something that is causing
> > this
> > > > > malfunction. But since it worked under Wicket 5, I'm hoping someone
> > > will
> > > > > see a relationship between the symptoms and a change that we need
> to
> > > make
> > > > > for compatibility with Wicket 6.
> > > > >
> > > > > Any hints or debugging ideas (since I can't step through the code
> > > running
> > > > > in AppEngine) would be greatly appreciated!
> > > > >
> > > > > Chris
> > > > >
> > > >
> > >
> >
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Christopher Merrill <ch...@webperformance.com>.
I'll do that. It'll take a few minutes to deploy that back up to AppEngine.

But I don't think that code will be executed - I feel pretty confident that
the event listeners are not being invoked. At least, my debug statements in
the event listener do not get into the AppEngine logs.

Chris


On Thu, May 14, 2015 at 4:23 PM, Martin Grigorov <mg...@apache.org>
wrote:

> Can you try something else:
> in onClick() add code like: getSession.setAttribute("test", new Date())
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
> chris@webperformance.com> wrote:
>
> > Thanks for your help, Martin!
> >
> > I turned off page recreation by adding:
> >
> > getPageSettings().setRecreateMountedPagesAfterExpiry(false);
> >
> > to my Application.init() method.
> >
> > There is no change in the behavior, either locally or in AppEngine --
> i.e.
> > no page expired errors.
> >
> > You can observe the behavior here:
> > http://1.wp-portal-staging.appspot.com/portal/pages/Test
> >
> > by visiting the page, refreshing it and then pressing a button (which
> will
> > do nothing if you refreshed). I posted the code for that page in another
> > thread ("Model value change lost between AjaxButton.onSubmit() and
> > form.onSubmit()"), in case that helps.
> >
> > TIA!
> > Chris
> >
> >
> >
> > On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <mg...@apache.org>
> > wrote:
> >
> > > Hi,
> > >
> > > My guess is that there is some problem with the saving of the page in
> the
> > > backing stores.
> > > Try by disabling page recreation for expired pages, see IPageSettings,
> > > If I'm right then you should start seeing PageExpiredPage after
> clicking
> > > the link.
> > > The next step is will be to find why the pages could not be stored.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
> > > chris@webperformance.com> wrote:
> > >
> > > > I'm seeing problems throughout our app where refreshing the page
> causes
> > > > other event listeners to then malfunction. These are trivially simple
> > > > listeners, like:
> > > >
> > > > Link customer_link = new Link("org_link")
> > > >     {
> > > >     @Override
> > > >     public void onClick()
> > > >         {
> > > >         setResponsePage(new
> > > > OrganizationAdministrationPage(getPageReference(),
> > > > _organization_key));
> > > >         }
> > > >
> > > >     private static final long serialVersionUID =
> -6396556709778260098L;
> > > >     };
> > > >
> > > >
> > > > Instead of returning the response page, the browser receives a
> forward
> > > > (302) back to the same page instance...which of course means that the
> > > link
> > > > appears to do nothing.
> > > >
> > > > I can only reproduce this behavior when the app is deployed to
> > AppEngine
> > > --
> > > > it works fine running on my desktop. The problems started when we
> > > upgraded
> > > > the application to Wicket 6. I'm not implying this is a Wicket 6
> > > > problem...in fact I assume we have done something that is causing
> this
> > > > malfunction. But since it worked under Wicket 5, I'm hoping someone
> > will
> > > > see a relationship between the symptoms and a change that we need to
> > make
> > > > for compatibility with Wicket 6.
> > > >
> > > > Any hints or debugging ideas (since I can't step through the code
> > running
> > > > in AppEngine) would be greatly appreciated!
> > > >
> > > > Chris
> > > >
> > >
> >
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Martin Grigorov <mg...@apache.org>.
Can you try something else:
in onClick() add code like: getSession.setAttribute("test", new Date())

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, May 14, 2015 at 11:18 PM, Christopher Merrill <
chris@webperformance.com> wrote:

> Thanks for your help, Martin!
>
> I turned off page recreation by adding:
>
> getPageSettings().setRecreateMountedPagesAfterExpiry(false);
>
> to my Application.init() method.
>
> There is no change in the behavior, either locally or in AppEngine -- i.e.
> no page expired errors.
>
> You can observe the behavior here:
> http://1.wp-portal-staging.appspot.com/portal/pages/Test
>
> by visiting the page, refreshing it and then pressing a button (which will
> do nothing if you refreshed). I posted the code for that page in another
> thread ("Model value change lost between AjaxButton.onSubmit() and
> form.onSubmit()"), in case that helps.
>
> TIA!
> Chris
>
>
>
> On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Hi,
> >
> > My guess is that there is some problem with the saving of the page in the
> > backing stores.
> > Try by disabling page recreation for expired pages, see IPageSettings,
> > If I'm right then you should start seeing PageExpiredPage after clicking
> > the link.
> > The next step is will be to find why the pages could not be stored.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
> > chris@webperformance.com> wrote:
> >
> > > I'm seeing problems throughout our app where refreshing the page causes
> > > other event listeners to then malfunction. These are trivially simple
> > > listeners, like:
> > >
> > > Link customer_link = new Link("org_link")
> > >     {
> > >     @Override
> > >     public void onClick()
> > >         {
> > >         setResponsePage(new
> > > OrganizationAdministrationPage(getPageReference(),
> > > _organization_key));
> > >         }
> > >
> > >     private static final long serialVersionUID = -6396556709778260098L;
> > >     };
> > >
> > >
> > > Instead of returning the response page, the browser receives a forward
> > > (302) back to the same page instance...which of course means that the
> > link
> > > appears to do nothing.
> > >
> > > I can only reproduce this behavior when the app is deployed to
> AppEngine
> > --
> > > it works fine running on my desktop. The problems started when we
> > upgraded
> > > the application to Wicket 6. I'm not implying this is a Wicket 6
> > > problem...in fact I assume we have done something that is causing this
> > > malfunction. But since it worked under Wicket 5, I'm hoping someone
> will
> > > see a relationship between the symptoms and a change that we need to
> make
> > > for compatibility with Wicket 6.
> > >
> > > Any hints or debugging ideas (since I can't step through the code
> running
> > > in AppEngine) would be greatly appreciated!
> > >
> > > Chris
> > >
> >
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Christopher Merrill <ch...@webperformance.com>.
Thanks for your help, Martin!

I turned off page recreation by adding:

getPageSettings().setRecreateMountedPagesAfterExpiry(false);

to my Application.init() method.

There is no change in the behavior, either locally or in AppEngine -- i.e.
no page expired errors.

You can observe the behavior here:
http://1.wp-portal-staging.appspot.com/portal/pages/Test

by visiting the page, refreshing it and then pressing a button (which will
do nothing if you refreshed). I posted the code for that page in another
thread ("Model value change lost between AjaxButton.onSubmit() and
form.onSubmit()"), in case that helps.

TIA!
Chris



On Thu, May 14, 2015 at 3:43 PM, Martin Grigorov <mg...@apache.org>
wrote:

> Hi,
>
> My guess is that there is some problem with the saving of the page in the
> backing stores.
> Try by disabling page recreation for expired pages, see IPageSettings,
> If I'm right then you should start seeing PageExpiredPage after clicking
> the link.
> The next step is will be to find why the pages could not be stored.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
> chris@webperformance.com> wrote:
>
> > I'm seeing problems throughout our app where refreshing the page causes
> > other event listeners to then malfunction. These are trivially simple
> > listeners, like:
> >
> > Link customer_link = new Link("org_link")
> >     {
> >     @Override
> >     public void onClick()
> >         {
> >         setResponsePage(new
> > OrganizationAdministrationPage(getPageReference(),
> > _organization_key));
> >         }
> >
> >     private static final long serialVersionUID = -6396556709778260098L;
> >     };
> >
> >
> > Instead of returning the response page, the browser receives a forward
> > (302) back to the same page instance...which of course means that the
> link
> > appears to do nothing.
> >
> > I can only reproduce this behavior when the app is deployed to AppEngine
> --
> > it works fine running on my desktop. The problems started when we
> upgraded
> > the application to Wicket 6. I'm not implying this is a Wicket 6
> > problem...in fact I assume we have done something that is causing this
> > malfunction. But since it worked under Wicket 5, I'm hoping someone will
> > see a relationship between the symptoms and a change that we need to make
> > for compatibility with Wicket 6.
> >
> > Any hints or debugging ideas (since I can't step through the code running
> > in AppEngine) would be greatly appreciated!
> >
> > Chris
> >
>

Re: How could refreshing a page cause future onClick() listeners to malfunction?

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

My guess is that there is some problem with the saving of the page in the
backing stores.
Try by disabling page recreation for expired pages, see IPageSettings,
If I'm right then you should start seeing PageExpiredPage after clicking
the link.
The next step is will be to find why the pages could not be stored.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, May 14, 2015 at 9:40 PM, Christopher Merrill <
chris@webperformance.com> wrote:

> I'm seeing problems throughout our app where refreshing the page causes
> other event listeners to then malfunction. These are trivially simple
> listeners, like:
>
> Link customer_link = new Link("org_link")
>     {
>     @Override
>     public void onClick()
>         {
>         setResponsePage(new
> OrganizationAdministrationPage(getPageReference(),
> _organization_key));
>         }
>
>     private static final long serialVersionUID = -6396556709778260098L;
>     };
>
>
> Instead of returning the response page, the browser receives a forward
> (302) back to the same page instance...which of course means that the link
> appears to do nothing.
>
> I can only reproduce this behavior when the app is deployed to AppEngine --
> it works fine running on my desktop. The problems started when we upgraded
> the application to Wicket 6. I'm not implying this is a Wicket 6
> problem...in fact I assume we have done something that is causing this
> malfunction. But since it worked under Wicket 5, I'm hoping someone will
> see a relationship between the symptoms and a change that we need to make
> for compatibility with Wicket 6.
>
> Any hints or debugging ideas (since I can't step through the code running
> in AppEngine) would be greatly appreciated!
>
> Chris
>