You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Eelco Hillenius (JIRA)" <ji...@apache.org> on 2007/06/26 03:38:25 UTC

[jira] Created: (WICKET-696) investigate whether calling setResponsePage in the constructor results in pollution of the page map

investigate whether calling setResponsePage in the constructor results in pollution of the page map
---------------------------------------------------------------------------------------------------

                 Key: WICKET-696
                 URL: https://issues.apache.org/jira/browse/WICKET-696
             Project: Wicket
          Issue Type: Bug
          Components: wicket
            Reporter: Eelco Hillenius




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


[jira] Commented: (WICKET-696) investigate whether calling setResponsePage in the constructor results in pollution of the page map

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508334 ] 

Johan Compagner commented on WICKET-696:
----------------------------------------

ahh yes
i was looking at the response phase but there is also an event phase

	public void processEvents(RequestCycle requestCycle)
	{
		if (!requestCycle.isRedirect())
		{
			page = getPage(requestCycle);
		}
	}

that will create the page, but then another RequestTarget is on top so the response phase takes that one.
That page is then created i dont know if it is also touched (so that it gets pushed into the pagemap)

> investigate whether calling setResponsePage in the constructor results in pollution of the page map
> ---------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-696
>                 URL: https://issues.apache.org/jira/browse/WICKET-696
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>            Reporter: Eelco Hillenius
>


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


[jira] Commented: (WICKET-696) investigate whether calling setResponsePage in the constructor results in pollution of the page map

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508325 ] 

Eelco Hillenius commented on WICKET-696:
----------------------------------------

It does work, and you can find in the list archives some people are using it (I may be using it myself somewhere).

Try this:

Index: /Users/eelcohillenius/Documents/workspace_wicket/trunk/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/helloworld/CopyOfHelloWorld.html
===================================================================
--- /Users/eelcohillenius/Documents/workspace_wicket/trunk/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/helloworld/CopyOfHelloWorld.html	(revision 0)
+++ /Users/eelcohillenius/Documents/workspace_wicket/trunk/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/helloworld/CopyOfHelloWorld.html	(revision 0)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head>
+    <title>Wicket Examples - copy of helloworld</title>
+    <link rel="stylesheet" type="text/css" href="style.css"/>
+</head>
+<body>
+<h3>Copy!</h3>
+    <span wicket:id="mainNavigation"/>
+    <span wicket:id="message" id="message">Message goes here</span>
+</body>
+</html>
Index: /Users/eelcohillenius/Documents/workspace_wicket/trunk/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/helloworld/CopyOfHelloWorld.java
===================================================================
--- /Users/eelcohillenius/Documents/workspace_wicket/trunk/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/helloworld/CopyOfHelloWorld.java	(revision 0)
+++ /Users/eelcohillenius/Documents/workspace_wicket/trunk/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/helloworld/CopyOfHelloWorld.java	(revision 0)
@@ -0,0 +1,37 @@

+package org.apache.wicket.examples.helloworld;
+
+import org.apache.wicket.examples.WicketExamplePage;
+import org.apache.wicket.markup.html.basic.Label;
+
+
+public class CopyOfHelloWorld extends WicketExamplePage
+{
+	/**
+	 * Constructor
+	 */
+	public CopyOfHelloWorld()
+	{
+		add(new Label("message", "Hello World!"));
+	}
+}
\ No newline at end of file
Index: /Users/eelcohillenius/Documents/workspace_wicket/trunk/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/helloworld/HelloWorld.java
===================================================================
--- /Users/eelcohillenius/Documents/workspace_wicket/trunk/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/helloworld/HelloWorld.java	(revision 550535)
+++ /Users/eelcohillenius/Documents/workspace_wicket/trunk/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/helloworld/HelloWorld.java	(working copy)
@@ -32,6 +32,7 @@
 	 */
 	public HelloWorld()
 	{
+		setResponsePage(new CopyOfHelloWorld());
 		add(new Label("message", "Hello World!"));
 	}
 }
\ No newline at end of file


> investigate whether calling setResponsePage in the constructor results in pollution of the page map
> ---------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-696
>                 URL: https://issues.apache.org/jira/browse/WICKET-696
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>            Reporter: Eelco Hillenius
>


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


[jira] Commented: (WICKET-696) investigate whether calling setResponsePage in the constructor results in pollution of the page map

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508322 ] 

Johan Compagner commented on WICKET-696:
----------------------------------------

as far as i can see in 1.3 we don't really have support anymore for setResponsePage in the constructor of another page

i believe that our PageFactory did look after construction if there was another page set in the mean time. But i can't find that code anymore.

So if you do setResponsePage now an a BookmarkablePageRequestTarget:

IPageFactory pageFactory = requestCycle.getApplication().getSessionSettings()
				.getPageFactory();

		if (pageParameters == null || pageParameters.size() == 0)
		{
			return pageFactory.newPage(pageClass);
		}
		else
		{
			// Add bookmarkable params in for WICKET-400.
			requestCycle.getRequest().getParameterMap().putAll(pageParameters);
			return pageFactory.newPage(pageClass, pageParameters);
		}

then that page is really rended as far as i can see.

als when you do this yourself in your own code:

Page page = new Page();
setResponsePage(page)

and the page constructor did set a response page it also doesn't work.
so throwing an exception is really the only way to do it.


> investigate whether calling setResponsePage in the constructor results in pollution of the page map
> ---------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-696
>                 URL: https://issues.apache.org/jira/browse/WICKET-696
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>            Reporter: Eelco Hillenius
>


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


[jira] Commented: (WICKET-696) investigate whether calling setResponsePage in the constructor results in pollution of the page map

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508032 ] 

Eelco Hillenius commented on WICKET-696:
----------------------------------------

Investigate whether calling setResponsePage in the constructor results in pollution of the page map. Alternatively, look at whether maybe it is a better idea to let that call throw the exception for you if the page is still constructing.

> investigate whether calling setResponsePage in the constructor results in pollution of the page map
> ---------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-696
>                 URL: https://issues.apache.org/jira/browse/WICKET-696
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>            Reporter: Eelco Hillenius
>


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