[jira] [Commented] (WICKET-6295) Clicking Link in BrowserInfoPage results in infinite request loop

2016-12-14 Thread Sven Meier (JIRA)

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

Sven Meier commented on WICKET-6295:


You're right, this is another thing I've fixed in 7.x and master:

Regardless how BrowserInfoPage is left, it will always try to redirect to the 
original destination and use the homepage as fallback.

If you have an idea how to keep the original destination for a second request, 
please open another ticket.

> Clicking Link in BrowserInfoPage results in infinite request loop
> -
>
> Key: WICKET-6295
> URL: https://issues.apache.org/jira/browse/WICKET-6295
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 6.25.0
>Reporter: Daniel Radünz
>Assignee: Sven Meier
> Fix For: 6.26
>
>
> Clicking on the link in the BrowserInfoPage used to gather extended browser 
> information results in an infinite loop in which the browser is alternating 
> between sending several GET and POST request per second for the 
> BrowserInfoPage.
> Based on QuickStart with Wicket 6.25:
> {code:Java|title=WicketApplication.java}
> ...
>   @Override
>   public void init()
>   {
>   super.init();
>   getRequestCycleSettings().setGatherExtendedBrowserInfo(true);
>   }
> ...
> {code}
> {code:Java|title=Homapage.java}
> public class HomePage extends WebPage {
>   private static final long serialVersionUID = 1L;
>   public HomePage(final PageParameters parameters) {
>   super(parameters);
>   // Get ClientInfo for example to conditionally add components
>   // further down in the code
>   ClientInfo clientInfo = Session.get().getClientInfo();
>   // Run code that takes a few seconds, just long enough to allow
>   // an impatient user to click the link in the BrowserInfoPage
>   try {
>   Thread.sleep(3000);
>   } catch (InterruptedException e) {
>   }
>   add(new Label("version", 
> getApplication().getFrameworkSettings().getVersion()));
> }
> }
> {code}
> Wicket 7 does not exhibit this behavior. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WICKET-6295) Clicking Link in BrowserInfoPage results in infinite request loop

2016-12-14 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on WICKET-6295:
-

Commit 5ce4f3e7051fcbc5039f4cc6ad485e10adde0913 in wicket's branch 
refs/heads/wicket-6.x from [~svenmeier]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=5ce4f3e ]

WICKET-6295 fallback to home page


> Clicking Link in BrowserInfoPage results in infinite request loop
> -
>
> Key: WICKET-6295
> URL: https://issues.apache.org/jira/browse/WICKET-6295
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 6.25.0
>Reporter: Daniel Radünz
>Assignee: Sven Meier
> Fix For: 6.26
>
>
> Clicking on the link in the BrowserInfoPage used to gather extended browser 
> information results in an infinite loop in which the browser is alternating 
> between sending several GET and POST request per second for the 
> BrowserInfoPage.
> Based on QuickStart with Wicket 6.25:
> {code:Java|title=WicketApplication.java}
> ...
>   @Override
>   public void init()
>   {
>   super.init();
>   getRequestCycleSettings().setGatherExtendedBrowserInfo(true);
>   }
> ...
> {code}
> {code:Java|title=Homapage.java}
> public class HomePage extends WebPage {
>   private static final long serialVersionUID = 1L;
>   public HomePage(final PageParameters parameters) {
>   super(parameters);
>   // Get ClientInfo for example to conditionally add components
>   // further down in the code
>   ClientInfo clientInfo = Session.get().getClientInfo();
>   // Run code that takes a few seconds, just long enough to allow
>   // an impatient user to click the link in the BrowserInfoPage
>   try {
>   Thread.sleep(3000);
>   } catch (InterruptedException e) {
>   }
>   add(new Label("version", 
> getApplication().getFrameworkSettings().getVersion()));
> }
> }
> {code}
> Wicket 7 does not exhibit this behavior. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


wicket git commit: WICKET-6295 fallback to home page

2016-12-14 Thread svenmeier
Repository: wicket
Updated Branches:
  refs/heads/wicket-6.x 0519f72b4 -> 5ce4f3e70


WICKET-6295 fallback to home page


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/5ce4f3e7
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/5ce4f3e7
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/5ce4f3e7

Branch: refs/heads/wicket-6.x
Commit: 5ce4f3e7051fcbc5039f4cc6ad485e10adde0913
Parents: 0519f72
Author: Sven Meier 
Authored: Wed Dec 14 21:13:36 2016 +0100
Committer: Sven Meier 
Committed: Wed Dec 14 21:13:36 2016 +0100

--
 .../java/org/apache/wicket/markup/html/pages/BrowserInfoPage.java | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/wicket/blob/5ce4f3e7/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoPage.java
--
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoPage.java
 
b/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoPage.java
index 3f82bf0..5212a8b 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoPage.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoPage.java
@@ -111,6 +111,9 @@ public class BrowserInfoPage extends WebPage
protected void afterSubmit()
{
continueToOriginalDestination();
+
+   // switch to home page if no original 
destination was intercepted
+   setResponsePage(getApplication().getHomePage());
}
};
add(browserInfoForm);



[jira] [Commented] (WICKET-6295) Clicking Link in BrowserInfoPage results in infinite request loop

2016-12-14 Thread JIRA

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

Daniel Radünz commented on WICKET-6295:
---

I've checked your new fix. The initial infinite loop is still fixed, but there 
is another one:

With JavaScript being enabled:
- Wait for the redirect to happen
- Press the back button in the browser -> infinite request loop

Probable cause:
When pressing the back button in the browser, the user ends up on the 
BrowserInfoPage instance from before again. The JavaScript in that page submits 
the BrowserInfoForm again, which triggers the {{afterSubmit()}} method
{code:Java|title=Wicket 6.26 SNAPSHOT}
protected void afterSubmit()
{
continueToOriginalDestination();
}
{code}

Comparing this to Wicket 7, where this infinte loop does not happen, reveals 
that there is a fallback to the home page in this method as well.
So the Wicket 6 code probably should be like that as well:
{code:Java|title=Wicket 7.5}
protected void afterSubmit()
{
continueToOriginalDestination();

// switch to home page if no original destination was intercepted
setResponsePage(getApplication().getHomePage());
}
{code}

When backporting this change from Wicket 7 to Wicket 6 as well, I get 
redirected to the home page after pressing the back button.

The redirect to the home page in itself, when the original destination is 
already consumed, is currently no issue in my project.

Maybe on instatiation of the BrowserInfoPage the original destination could be 
saved via {{RestartResponseAtInterceptPageException.getOriginalUrl();}} to a 
local field. Then using that, instead of {{continueToOriginalDestination()}}, 
might do the trick to always redirect the original destination, no matter if 
the user clicked the link twice or used the back button. But this probably 
warrants a seperate ticket at some point, since the implications of this 
potentiel solution are currently unclear to me. I'd need to dig deeper into the 
internals of Wicket and would have to do some extended testing.

> Clicking Link in BrowserInfoPage results in infinite request loop
> -
>
> Key: WICKET-6295
> URL: https://issues.apache.org/jira/browse/WICKET-6295
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 6.25.0
>Reporter: Daniel Radünz
>Assignee: Sven Meier
> Fix For: 6.26
>
>
> Clicking on the link in the BrowserInfoPage used to gather extended browser 
> information results in an infinite loop in which the browser is alternating 
> between sending several GET and POST request per second for the 
> BrowserInfoPage.
> Based on QuickStart with Wicket 6.25:
> {code:Java|title=WicketApplication.java}
> ...
>   @Override
>   public void init()
>   {
>   super.init();
>   getRequestCycleSettings().setGatherExtendedBrowserInfo(true);
>   }
> ...
> {code}
> {code:Java|title=Homapage.java}
> public class HomePage extends WebPage {
>   private static final long serialVersionUID = 1L;
>   public HomePage(final PageParameters parameters) {
>   super(parameters);
>   // Get ClientInfo for example to conditionally add components
>   // further down in the code
>   ClientInfo clientInfo = Session.get().getClientInfo();
>   // Run code that takes a few seconds, just long enough to allow
>   // an impatient user to click the link in the BrowserInfoPage
>   try {
>   Thread.sleep(3000);
>   } catch (InterruptedException e) {
>   }
>   add(new Label("version", 
> getApplication().getFrameworkSettings().getVersion()));
> }
> }
> {code}
> Wicket 7 does not exhibit this behavior. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)