[jira] Commented: (WICKET-3161) Can not create cookies
[ https://issues.apache.org/jira/browse/WICKET-3161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931647#action_12931647 ] Peter Ertl commented on WICKET-3161: Removing reset() will not change anything The set-cookie action gets lost when redirecting_to_buffer to redirect to a clean url after invoking the link listener, in WebPageRenderer in approx. line 123 in trunk // keep the original response final Response originalResponse = requestCycle.getResponse(); // buffered web response for page (the set-cookie action in originalResponse, which is of type HeaderBufferingWebResponse, is dropped here) BufferedWebResponse response = new BufferedWebResponse((WebResponse)originalResponse); // keep the original base URL Url originalBaseUrl = requestCycle.getUrlRenderer().setBaseUrl(targetUrl); copying originalResponse over to response does not copy over the set cookie action. still investigating further on this... > Can not create cookies > -- > > Key: WICKET-3161 > URL: https://issues.apache.org/jira/browse/WICKET-3161 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.5-M3 > Environment: Windows 7, Intel i7 >Reporter: Ivaylo Stoykov > Attachments: quickstart.zip > > > Hi, > I'm migrating to wicket 1.5-M3 and I've encountered a problem. I can not > create cookies (I presume that I can't delete them either). > I've looked through the source code and this is what I found: > I add the cookie to the response and I end up with a nice > HeaderBufferingWebResponse which contains BufferedWebResponse$AddCookieAction. > But then redirectTo(Url, RequestCycle) from WebPageRenderer class is called. > Here is the method: > >private void redirectTo(Url url, RequestCycle requestCycle) > { > WebResponse response = (WebResponse)requestCycle.getResponse(); > String relativeUrl = > requestCycle.getUrlRenderer().renderUrl(url); > response.reset(); > response.sendRedirect(relativeUrl); > } > response.reset(); - removes all actions from the request. > So after this method my request has got only > BufferedWebResponse$SendRedirectAction. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r1034726 - in /wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http: BufferedWebResponse.java HeaderBufferingWebResponse.java IBufferedWebResponse.java
Author: pete Date: Sat Nov 13 10:53:57 2010 New Revision: 1034726 URL: http://svn.apache.org/viewvc?rev=1034726&view=rev Log: transfer-buffered-cookie-operations Added: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/HeaderBufferingWebResponse.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java?rev=1034726&r1=1034725&r2=1034726&view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java Sat Nov 13 10:53:57 2010 @@ -36,7 +36,7 @@ import org.apache.wicket.util.lang.Args; * * @author Matej Knopp */ -public class BufferedWebResponse extends WebResponse +public class BufferedWebResponse extends WebResponse implements IBufferedWebResponse { private final transient WebResponse originalResponse; @@ -47,9 +47,30 @@ public class BufferedWebResponse extends */ public BufferedWebResponse(WebResponse originalResponse) { + // if original response had some cookies set we should not forget to transfer them + if(originalResponse instanceof IBufferedWebResponse) + ((IBufferedWebResponse) originalResponse).transferCookies(this); + this.originalResponse = originalResponse; } + /** +* transfer cookie operations (add, clear) to given web response +* +* @param response web response that should receive the current cookie operation +*/ + public void transferCookies(WebResponse response) + { + for (Action action : actions) + { + if (action instanceof AddCookieAction) + action.invoke(response); + else if (action instanceof ClearCookieAction) + action.invoke(response); + } + } + + @Override public String encodeURL(CharSequence url) { Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/HeaderBufferingWebResponse.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/HeaderBufferingWebResponse.java?rev=1034726&r1=1034725&r2=1034726&view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/HeaderBufferingWebResponse.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/HeaderBufferingWebResponse.java Sat Nov 13 10:53:57 2010 @@ -33,7 +33,7 @@ import org.apache.wicket.request.http.We * * @author Matej Knopp */ -class HeaderBufferingWebResponse extends WebResponse +class HeaderBufferingWebResponse extends WebResponse implements IBufferedWebResponse { private final WebResponse originalResponse; private final BufferedWebResponse bufferedResponse; @@ -175,4 +175,9 @@ class HeaderBufferingWebResponse extends bufferedResponse.reset(); bufferedWritten = false; } + + public void transferCookies(WebResponse webResponse) + { + bufferedResponse.transferCookies(webResponse); + } } Added: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java?rev=1034726&view=auto == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java (added) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java Sat Nov 13 10:53:57 2010 @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WAR
svn commit: r1034729 - in /wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http: BufferedWebResponse.java IBufferedWebResponse.java
Author: pete Date: Sat Nov 13 11:00:01 2010 New Revision: 1034729 URL: http://svn.apache.org/viewvc?rev=1034729&view=rev Log: WICKET-3161: cookies that are set during a buffered web response will not be transferred over redirecting. The solution to this issue is not what I consider pretty so please take time to review and feel free to improve it. Sorry for the last commit message (I intended to create a path but was clicking too fast) The previous commit is part of WICKET-3161 Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java?rev=1034729&r1=1034728&r2=1034729&view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java Sat Nov 13 11:00:01 2010 @@ -47,7 +47,8 @@ public class BufferedWebResponse extends */ public BufferedWebResponse(WebResponse originalResponse) { - // if original response had some cookies set we should not forget to transfer them + // if original response had some cookies set we should not forget + // to transfer them to the current response if(originalResponse instanceof IBufferedWebResponse) ((IBufferedWebResponse) originalResponse).transferCookies(this); Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java?rev=1034729&r1=1034728&r2=1034729&view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java Sat Nov 13 11:00:01 2010 @@ -20,5 +20,10 @@ import org.apache.wicket.request.http.We interface IBufferedWebResponse { + /** +* transfer cookie operations (add + clear cookie) to given web response +* +* @param webResponse web response that should receive the current cookie operation +*/ void transferCookies(WebResponse webResponse); }
svn commit: r1034731 - in /wicket/trunk/wicket/src: main/java/org/apache/wicket/protocol/http/ main/java/org/apache/wicket/protocol/http/mock/ main/java/org/apache/wicket/util/tester/ test/java/org/ap
Author: pete Date: Sat Nov 13 11:54:01 2010 New Revision: 1034731 URL: http://svn.apache.org/viewvc?rev=1034731&view=rev Log: WICKET-3161: added test case Added: wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePage.html - copied, changed from r1034699, wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/FirstPage.html wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePage.java wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePageTest.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/mock/MockHttpServletResponse.java wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java?rev=1034731&r1=1034730&r2=1034731&view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java Sat Nov 13 11:54:01 2010 @@ -18,7 +18,7 @@ package org.apache.wicket.protocol.http; import org.apache.wicket.request.http.WebResponse; -interface IBufferedWebResponse +public interface IBufferedWebResponse { /** * transfer cookie operations (add + clear cookie) to given web response Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/mock/MockHttpServletResponse.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/mock/MockHttpServletResponse.java?rev=1034731&r1=1034730&r2=1034731&view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/mock/MockHttpServletResponse.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/mock/MockHttpServletResponse.java Sat Nov 13 11:54:01 2010 @@ -36,6 +36,8 @@ import javax.servlet.ServletOutputStream import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; +import org.apache.wicket.protocol.http.IBufferedWebResponse; +import org.apache.wicket.request.http.WebResponse; import org.apache.wicket.util.value.ValueMap; @@ -45,7 +47,7 @@ import org.apache.wicket.util.value.Valu * * @author Chris Turner */ -public class MockHttpServletResponse implements HttpServletResponse +public class MockHttpServletResponse implements HttpServletResponse, IBufferedWebResponse { private static final int MODE_BINARY = 1; @@ -815,4 +817,10 @@ public class MockHttpServletResponse imp { return Collections.singletonList(headers.get(name).toString()); } + + public void transferCookies(WebResponse webResponse) + { + for (Cookie cookie : cookies) + webResponse.addCookie(cookie); + } } \ No newline at end of file Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java?rev=1034731&r1=1034730&r2=1034731&view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java Sat Nov 13 11:54:01 2010 @@ -76,6 +76,7 @@ import org.apache.wicket.mock.MockReques import org.apache.wicket.mock.MockSessionStore; import org.apache.wicket.page.IPageManager; import org.apache.wicket.page.IPageManagerContext; +import org.apache.wicket.protocol.http.IBufferedWebResponse; import org.apache.wicket.protocol.http.WebApplication; import org.apache.wicket.protocol.http.WicketFilter; import org.apache.wicket.protocol.http.mock.MockHttpServletRequest; @@ -97,6 +98,7 @@ import org.apache.wicket.request.handler import org.apache.wicket.request.handler.PageProvider; import org.apache.wicket.request.handler.RenderPageRequestHandler; import org.apache.wicket.request.handler.render.PageRenderer; +import org.apache.wicket.request.http.WebResponse; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.session.ISessionStore; import org.apache.wicket.settings.IRequestCycleSettings.RenderStrategy; @@ -324,22 +326,7 @@ public class BaseWicketTester */ private ServletWebResponse createServletWebResponse(ServletWebRequest servletWe
svn commit: r1034735 - in /wicket/trunk/wicket/src/main/java/org/apache/wicket: protocol/http/ protocol/http/mock/ util/tester/
Author: pete Date: Sat Nov 13 11:58:56 2010 New Revision: 1034735 URL: http://svn.apache.org/viewvc?rev=1034735&view=rev Log: WICKET-3161: improve naming Added: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/ICookieSavingResponse.java - copied, changed from r1034731, wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java Removed: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/HeaderBufferingWebResponse.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/mock/MockHttpServletResponse.java wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java?rev=1034735&r1=1034734&r2=1034735&view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java Sat Nov 13 11:58:56 2010 @@ -36,7 +36,7 @@ import org.apache.wicket.util.lang.Args; * * @author Matej Knopp */ -public class BufferedWebResponse extends WebResponse implements IBufferedWebResponse +public class BufferedWebResponse extends WebResponse implements ICookieSavingResponse { private final transient WebResponse originalResponse; @@ -47,10 +47,10 @@ public class BufferedWebResponse extends */ public BufferedWebResponse(WebResponse originalResponse) { - // if original response had some cookies set we should not forget - // to transfer them to the current response - if(originalResponse instanceof IBufferedWebResponse) - ((IBufferedWebResponse) originalResponse).transferCookies(this); + // if original response eventually had some cookies set + // we should transfer them to the current response + if(originalResponse instanceof ICookieSavingResponse) + ((ICookieSavingResponse) originalResponse).transferCookies(this); this.originalResponse = originalResponse; } Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/HeaderBufferingWebResponse.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/HeaderBufferingWebResponse.java?rev=1034735&r1=1034734&r2=1034735&view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/HeaderBufferingWebResponse.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/HeaderBufferingWebResponse.java Sat Nov 13 11:58:56 2010 @@ -33,7 +33,7 @@ import org.apache.wicket.request.http.We * * @author Matej Knopp */ -class HeaderBufferingWebResponse extends WebResponse implements IBufferedWebResponse +class HeaderBufferingWebResponse extends WebResponse implements ICookieSavingResponse { private final WebResponse originalResponse; private final BufferedWebResponse bufferedResponse; Copied: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/ICookieSavingResponse.java (from r1034731, wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java) URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/ICookieSavingResponse.java?p2=wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/ICookieSavingResponse.java&p1=wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java&r1=1034731&r2=1034735&rev=1034735&view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IBufferedWebResponse.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/ICookieSavingResponse.java Sat Nov 13 11:58:56 2010 @@ -18,12 +18,17 @@ package org.apache.wicket.protocol.http; import org.apache.wicket.request.http.WebResponse; -public interface IBufferedWebResponse +/** + * any kind of response that is capable of remembering the cookies that were set + * + * this is for example needed to save the cookies during a redirect to buffer operation + */ +public interface ICookieSavingResponse { /** -* transfer cookie operations (add + clear cookie) to given web resp
[jira] Assigned: (WICKET-3161) Can not create cookies
[ https://issues.apache.org/jira/browse/WICKET-3161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Peter Ertl reassigned WICKET-3161: -- Assignee: Peter Ertl > Can not create cookies > -- > > Key: WICKET-3161 > URL: https://issues.apache.org/jira/browse/WICKET-3161 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.5-M3 > Environment: Windows 7, Intel i7 >Reporter: Ivaylo Stoykov >Assignee: Peter Ertl > Attachments: quickstart.zip > > > Hi, > I'm migrating to wicket 1.5-M3 and I've encountered a problem. I can not > create cookies (I presume that I can't delete them either). > I've looked through the source code and this is what I found: > I add the cookie to the response and I end up with a nice > HeaderBufferingWebResponse which contains BufferedWebResponse$AddCookieAction. > But then redirectTo(Url, RequestCycle) from WebPageRenderer class is called. > Here is the method: > >private void redirectTo(Url url, RequestCycle requestCycle) > { > WebResponse response = (WebResponse)requestCycle.getResponse(); > String relativeUrl = > requestCycle.getUrlRenderer().renderUrl(url); > response.reset(); > response.sendRedirect(relativeUrl); > } > response.reset(); - removes all actions from the request. > So after this method my request has got only > BufferedWebResponse$SendRedirectAction. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r1034736 - in /wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http: ModifyCookiePage.java ModifyCookiePageTest.java
Author: pete Date: Sat Nov 13 12:06:54 2010 New Revision: 1034736 URL: http://svn.apache.org/viewvc?rev=1034736&view=rev Log: WICKET-3161: added missing apache license headers Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePage.java wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePageTest.java Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePage.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePage.java?rev=1034736&r1=1034735&r2=1034736&view=diff == --- wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePage.java (original) +++ wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePage.java Sat Nov 13 12:06:54 2010 @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.protocol.http; import org.apache.wicket.Component; Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePageTest.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePageTest.java?rev=1034736&r1=1034735&r2=1034736&view=diff == --- wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePageTest.java (original) +++ wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/ModifyCookiePageTest.java Sat Nov 13 12:06:54 2010 @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.wicket.protocol.http; import junit.framework.TestCase;
[jira] Created: (WICKET-3166) isVisibleInHierarchy() possibly unnecessarily checks children whose parents are invisible?
isVisibleInHierarchy() possibly unnecessarily checks children whose parents are invisible? -- Key: WICKET-3166 URL: https://issues.apache.org/jira/browse/WICKET-3166 Project: Wicket Issue Type: Bug Affects Versions: 1.4.13 Reporter: Martin Makundi Attachments: Wicket-Quickstart.zip Hi! See attached quickstart with junit test reproducing the bug. See also patch proposal. I have a page with two panels: page.form.add(panel1); page.form.add(panel2); in some situations panel1 is not visible. However, a form submit event will visit all formcomponents of panel1 via: at org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder(FormComponent.java:400) at org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(Form.java:1209) at org.apache.wicket.markup.html.form.Form.inputChanged(Form.java:1403) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:865) This results in a crash because panel1 components are not prepared to be invoked via isvisible when the panel itself is not visible. I wonder if the component.isVisibleInHierarchy could be changed as follows, to first check parent visibility: public final boolean isVisibleInHierarchy() { Component component = this; while (component != null) { Component componentParent = component.getParent(); if (((componentParent == null) || componentParent.isVisibleInHierarchy()) && component.determineVisibility()) { component = componentParent; } else { return false; } } return true; } Similar change could/should maybe be possible also for isEnabledInHierarchy ? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-3166) isVisibleInHierarchy() possibly unnecessarily checks children whose parents are invisible?
[ https://issues.apache.org/jira/browse/WICKET-3166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Makundi updated WICKET-3166: --- Attachment: Wicket-Quickstart.zip junit test case to Reproduce the issue. > isVisibleInHierarchy() possibly unnecessarily checks children whose parents > are invisible? > -- > > Key: WICKET-3166 > URL: https://issues.apache.org/jira/browse/WICKET-3166 > Project: Wicket > Issue Type: Bug >Affects Versions: 1.4.13 >Reporter: Martin Makundi > Attachments: Wicket-Quickstart.zip > > Original Estimate: 1h > Remaining Estimate: 1h > > Hi! > See attached quickstart with junit test reproducing the bug. See also patch > proposal. > I have a page with two panels: > page.form.add(panel1); > page.form.add(panel2); > in some situations panel1 is not visible. > However, a form submit event will visit all formcomponents of panel1 via: >at > org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder(FormComponent.java:400) >at > org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(Form.java:1209) >at org.apache.wicket.markup.html.form.Form.inputChanged(Form.java:1403) >at > org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:865) > This results in a crash because panel1 components are not prepared to > be invoked via isvisible when the panel itself is not visible. > I wonder if the component.isVisibleInHierarchy could be changed as > follows, to first check parent visibility: > public final boolean isVisibleInHierarchy() > { >Component component = this; >while (component != null) >{ > Component componentParent = component.getParent(); > if (((componentParent == null) || > componentParent.isVisibleInHierarchy()) && > component.determineVisibility()) > { >component = componentParent; > } > else > { >return false; > } >} >return true; > } > Similar change could/should maybe be possible also for isEnabledInHierarchy ? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-3166) isVisibleInHierarchy() possibly unnecessarily checks children whose parents are invisible?
[ https://issues.apache.org/jira/browse/WICKET-3166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Makundi updated WICKET-3166: --- Attachment: diff.txt Fix patch proposal, few lines at Component.isVisibleInHierarchy only. > isVisibleInHierarchy() possibly unnecessarily checks children whose parents > are invisible? > -- > > Key: WICKET-3166 > URL: https://issues.apache.org/jira/browse/WICKET-3166 > Project: Wicket > Issue Type: Bug >Affects Versions: 1.4.13 >Reporter: Martin Makundi > Attachments: diff.txt, Wicket-Quickstart.zip > > Original Estimate: 1h > Remaining Estimate: 1h > > Hi! > See attached quickstart with junit test reproducing the bug. See also patch > proposal. > I have a page with two panels: > page.form.add(panel1); > page.form.add(panel2); > in some situations panel1 is not visible. > However, a form submit event will visit all formcomponents of panel1 via: >at > org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder(FormComponent.java:400) >at > org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(Form.java:1209) >at org.apache.wicket.markup.html.form.Form.inputChanged(Form.java:1403) >at > org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:865) > This results in a crash because panel1 components are not prepared to > be invoked via isvisible when the panel itself is not visible. > I wonder if the component.isVisibleInHierarchy could be changed as > follows, to first check parent visibility: > public final boolean isVisibleInHierarchy() > { >Component component = this; >while (component != null) >{ > Component componentParent = component.getParent(); > if (((componentParent == null) || > componentParent.isVisibleInHierarchy()) && > component.determineVisibility()) > { >component = componentParent; > } > else > { >return false; > } >} >return true; > } > Similar change could/should maybe be possible also for isEnabledInHierarchy ? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-3161) Can not create cookies
[ https://issues.apache.org/jira/browse/WICKET-3161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Peter Ertl resolved WICKET-3161. Resolution: Fixed Fix Version/s: 1.5-M4 I am confident that this issue is fixed but I am not very happy about the solution. Please feel free to improve it or send me feedback. I also added a test case in wicket source to test for existance of cookies that were set during a link listener event. General question to wicket devs: Is it ok to "resolve issue" if I am not happy with a solution but the issue is fixed? > Can not create cookies > -- > > Key: WICKET-3161 > URL: https://issues.apache.org/jira/browse/WICKET-3161 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.5-M3 > Environment: Windows 7, Intel i7 >Reporter: Ivaylo Stoykov >Assignee: Peter Ertl > Fix For: 1.5-M4 > > Attachments: quickstart.zip > > > Hi, > I'm migrating to wicket 1.5-M3 and I've encountered a problem. I can not > create cookies (I presume that I can't delete them either). > I've looked through the source code and this is what I found: > I add the cookie to the response and I end up with a nice > HeaderBufferingWebResponse which contains BufferedWebResponse$AddCookieAction. > But then redirectTo(Url, RequestCycle) from WebPageRenderer class is called. > Here is the method: > >private void redirectTo(Url url, RequestCycle requestCycle) > { > WebResponse response = (WebResponse)requestCycle.getResponse(); > String relativeUrl = > requestCycle.getUrlRenderer().renderUrl(url); > response.reset(); > response.sendRedirect(relativeUrl); > } > response.reset(); - removes all actions from the request. > So after this method my request has got only > BufferedWebResponse$SendRedirectAction. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r1034744 - in /wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util: file/WebXmlFile.java xml/ xml/CustomEntityResolver.java
Author: pete Date: Sat Nov 13 12:19:30 2010 New Revision: 1034744 URL: http://svn.apache.org/viewvc?rev=1034744&view=rev Log: WICKET-3163: support offline builds of wicket (avoid hitting java.sun.com for lookup of web.xml 2.3 DTD) Added: wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/xml/ wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/xml/CustomEntityResolver.java Modified: wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/file/WebXmlFile.java Modified: wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/file/WebXmlFile.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/file/WebXmlFile.java?rev=1034744&r1=1034743&r2=1034744&view=diff == --- wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/file/WebXmlFile.java (original) +++ wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/file/WebXmlFile.java Sat Nov 13 12:19:30 2010 @@ -25,6 +25,7 @@ import javax.xml.parsers.DocumentBuilder import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; +import org.apache.wicket.util.xml.CustomEntityResolver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -34,7 +35,7 @@ import org.xml.sax.SAXException; /** * A utility class providing helper methods in dealing with web.xml - * + * * @author jcompagner * @author Juergen Donnerstag */ @@ -51,7 +52,7 @@ public class WebXmlFile /** * Gets Wicket filter path via FilterConfig -* +* * @param isServlet *true if Servlet, false if Filter * @param filterConfig @@ -65,7 +66,7 @@ public class WebXmlFile /** * Gets Wicket filter path via ServletContext and the filter name -* +* * @param isServlet *true if Servlet, false if Filter * @param servletContext @@ -109,7 +110,7 @@ public class WebXmlFile * web.xml file. * * A typical Wicket web.xml entry looks like: -* +* * * *@@ -120,7 +121,7 @@ public class WebXmlFile * -* +* *org.apache.wicket.examples.helloworld.HelloWorldApplication * ** * * -* +* * @param isServlet *true if Servlet, false if Filter * @param filterName @@ -145,6 +146,7 @@ public class WebXmlFile { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); + builder.setEntityResolver(CustomEntityResolver.getPreloaded()); // try to pull DTD from local set of entities Document document = builder.parse(is); String tag = (isServlet ? "servlet" : "filter"); @@ -173,7 +175,7 @@ public class WebXmlFile /** * Iterate through all children of 'node' and search for a node with name "filterName". Return * the value of node "url-pattern" if "filterName" was found. -* +* * @param filterName * @param name * @param node @@ -215,7 +217,7 @@ public class WebXmlFile /** * Find a node with name 'mapping' within 'nodeList' and if found continue to search amongst its * children for a node with 'filterName' and "url-pattern' -* +* * @param filterName * @param mapping * @param name Added: wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/xml/CustomEntityResolver.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/xml/CustomEntityResolver.java?rev=1034744&view=auto == --- wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/xml/CustomEntityResolver.java (added) +++ wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/xml/CustomEntityResolver.java Sat Nov 13 12:19:30 2010 @@ -0,0 +1,157 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License atHelloWorldApplication */helloworld/* @@ -129,7 +130,7 @@ public class WebXmlFile *
[jira] Resolved: (WICKET-3163) support building wicket offline by resolving DTD references locally
[ https://issues.apache.org/jira/browse/WICKET-3163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Peter Ertl resolved WICKET-3163. Resolution: Fixed Fix Version/s: 1.5-M4 Checked in a custom entity resolver that pulls web.xml 2.3 DTD right from inside servlet-api.jar. For verification I added 127.0.0.1 java.sun.com to /etc/hosts which makes the build fail. After applying the fix the builds still works fine, even when pointing java.sun.com to localhost :-) This also removes some possible wait on a slow internet connection. > support building wicket offline by resolving DTD references locally > --- > > Key: WICKET-3163 > URL: https://issues.apache.org/jira/browse/WICKET-3163 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 1.5-M3 >Reporter: Peter Ertl >Assignee: Peter Ertl > Fix For: 1.5-M4 > > Attachments: local-lookup.patch, LocalEntityResolver.java > > > Wicket developers, please give me some comment on this: > Some wicket test cases parse XML which refers to an external DTD. > An example is org.apache.wicket.protocol.http.WicketFilterTest > It refers to org.apache.wicket.util.file.WebXmlFile will will parse a custom > web.xml. > The web.xml will make the parser to look up > http://java.sun.com/dtd/web-app_2_3.dtd > When building wicket offline this will cause a network error and the test > will fail. > I would like to add > org.apache.wicket.util.xml.LocalEntityResolver > which may contain a set of local entitites to avoid hitting the network. > As wicket 1.5 is getting close to final I would like to get some feedback > first before putting that into trunk... > By adding this like to WebXmlFile network lookup would be avoided. > > DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); > DocumentBuilder builder = factory.newDocumentBuilder(); > builder.setEntityResolver(LocalEntityResolver.getDefault()); // no more > network lookups > Document document = builder.parse(is); > > package org.apache.wicket.util.xml; > import org.apache.wicket.util.lang.Args; > import org.xml.sax.EntityResolver; > import org.xml.sax.InputSource; > import org.xml.sax.SAXException; > import javax.servlet.Filter; > import java.io.IOException; > import java.io.InputStream; > import java.util.HashMap; > import java.util.Map; > /** > * entity resolver that tries to locate a document type definition (DTD) > using a set of custom entity resolvers > * > * @author pete > */ > public class LocalEntityResolver implements EntityResolver > { > private final Map entities = new > HashMap(3); > public static LocalEntityResolver getDefault() > { > LocalEntityResolver resolver = new LocalEntityResolver(); > > // > // look up servlet 2.3 web.xml DTD right from inside servlet-api.jar > // > resolver.put(new EntityKey("-//Sun Microsystems, Inc.//DTD Web > Application 2.3//EN", > > "http://java.sun.com/dtd/web-app_2_3.dtd";), >new ServletApiEntityLocator("web-app_2_3.dtd")); > return resolver; > } > public void put(EntityKey key, EntityLocator locator) > { > Args.notNull(key, "key"); > Args.notNull(locator, "locator"); > entities.put(key, locator); > } > public InputSource resolveEntity(String id, String url) throws > SAXException, IOException > { > for (Map.Entry entry : > entities.entrySet()) > if (entry.getKey().id.equals(id) || > entry.getKey().url.equals(url)) > return entry.getValue().locateInputSource(); > return null; > } > public static class EntityKey > { > private final String id; > private final String url; > private EntityKey(String id, String url) > { > Args.notEmpty(id, "id"); > Args.notEmpty(url, "url"); > this.id = id; > this.url = url; > } > @Override > public boolean equals(Object o) > { > if (this == o) > return true; > if (!(o instanceof EntityKey)) > return false; > EntityKey key = (EntityKey) o; > if (!id.equals(key.id)) > return false; > return url.equals(key.url); > } > @Override >
[jira] Commented: (WICKET-466) [datetime] Make DateConverter focus on joda-time.DateTime instead of util.Date
[ https://issues.apache.org/jira/browse/WICKET-466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931664#action_12931664 ] Juergen Donnerstag commented on WICKET-466: --- looking at the 1.5 code, it seems to be implemented already. At least it's using joda. > [datetime] Make DateConverter focus on joda-time.DateTime instead of util.Date > -- > > Key: WICKET-466 > URL: https://issues.apache.org/jira/browse/WICKET-466 > Project: Wicket > Issue Type: Improvement > Components: wicket-datetime >Affects Versions: 1.3.0-beta1 >Reporter: Chuck Deal >Priority: Minor > Fix For: 1.5-M4 > > Attachments: datetime.zip, datetime_patch.txt, datetime_patch.txt, > datetime_patch.txt, datetime_patch.txt, datetime_patch.txt, > quickstart-datetimeconverter.zip, wicket-datetime.patch > > > I beleive the Wicket-datetime package was designed to be used with joda-time > DateTime objects. It was also desirable to apply the "better" > parsing/toString features of DateTime to util.Date objects. To that end, the > attached patch improves the focus of the Converter to be DateTime oriented, > while still allowing the DateTextField to hold util.Dates in it's model. > The main idea of this patch is to make this package work with DateTime > objects with very little effort on the developer's part. If they want to > take advantage of the improved parsing, etc then it should take minimal > effort. > See http://www.nabble.com/-datetime--DateConverter-tf3233793.html for a brief > history of this conversation. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Closed: (WICKET-701) Allow wicket filter-mapping to use servlet-name instead of url-pattern
[ https://issues.apache.org/jira/browse/WICKET-701?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Juergen Donnerstag closed WICKET-701. - Resolution: Fixed Assignee: Juergen Donnerstag seems to be fixed in 1.5. See WicketSessionFilter > Allow wicket filter-mapping to use servlet-name instead of url-pattern > -- > > Key: WICKET-701 > URL: https://issues.apache.org/jira/browse/WICKET-701 > Project: Wicket > Issue Type: New Feature > Components: wicket >Affects Versions: 1.3.1 >Reporter: James Renfro >Assignee: Juergen Donnerstag > Fix For: 1.5-M4 > > > In the web.xml filter-mapping tag it's possible to map filters to either a > url-pattern or a servlet-name. Currently Wicket only allows a url-pattern, > and in the getFilterPath code an exception is thrown if servlet-name is used > instead. > I'm guessing the logic was that if you're going to do a filter-mapping to a > servlet then you may as well use WicketServlet. And it looks like the code > needs a way to grab the underlying url-pattern -- if you implement the > WicketServlet instead, wicket seems to force you to have a servlet-mapping to > a url-pattern -- so getFilterPath can calculate relative paths, it looks > like... But there are cases in certain frameworks (Sakai -- > www.sakaiproject.org -- is one example) where a portal is forwarding control > directly to a servlet by name, and the url-pattern doesn't really make any > sense. It'd be cleaner (from the point of view of my code at least) if Wicket > would accept that in certain cases there is no url-pattern defined. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Closed: (WICKET-1237) Support for AlternateParent in containers
[ https://issues.apache.org/jira/browse/WICKET-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Juergen Donnerstag closed WICKET-1237. -- Resolution: Fixed Assignee: Juergen Donnerstag in 1.5 add() can be subclassed > Support for AlternateParent in containers > - > > Key: WICKET-1237 > URL: https://issues.apache.org/jira/browse/WICKET-1237 > Project: Wicket > Issue Type: New Feature > Components: wicket >Affects Versions: 1.4-M1 > Environment: n.a. >Reporter: Jan Vermeulen >Assignee: Juergen Donnerstag > Fix For: 1.5-M4 > > > Provide (or backport from 2.0) an IAlternateParent interface, that allows to > define an alternative parent to add child components. > That should allow us to create components, where users can add child > components to a 'blackbox' component directly, while they are actually added > to some internal container (that you don't want to expose). > One option was to allow the 'add()' to be overridden, but that seemed to be > unacceptable. The other was to have an interface IAlternateParent that was > considered within the add(). That was what 2.0 offered. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3138) Wicket 1.5 and GAE
[ https://issues.apache.org/jira/browse/WICKET-3138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931670#action_12931670 ] Hudson commented on WICKET-3138: Integrated in Apache Wicket 1.5.x #507 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.5.x/507/]) > Wicket 1.5 and GAE > -- > > Key: WICKET-3138 > URL: https://issues.apache.org/jira/browse/WICKET-3138 > Project: Wicket > Issue Type: New Feature > Components: wicket >Affects Versions: 1.5-M2.1 >Reporter: Alexandru Objelean >Assignee: Martin Grigorov > Fix For: 1.5-M4 > > > Create a http session based store to make wicket 1.5 work with GAE -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3149) Merge DecoratingHeaderResponse to trunk
[ https://issues.apache.org/jira/browse/WICKET-3149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931669#action_12931669 ] Hudson commented on WICKET-3149: Integrated in Apache Wicket 1.5.x #507 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.5.x/507/]) > Merge DecoratingHeaderResponse to trunk > --- > > Key: WICKET-3149 > URL: https://issues.apache.org/jira/browse/WICKET-3149 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 1.5-M2.1 >Reporter: Martin Grigorov >Assignee: Jeremy Thomerson > Fix For: 1.5-M4 > > > Merge changes about DecoratingHeaderResponse to trunk. > Related SVN commits: > 1030625 > 1031154 > 1031432 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Closed: (WICKET-982) Add accessibility support
[ https://issues.apache.org/jira/browse/WICKET-982?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Juergen Donnerstag closed WICKET-982. - Resolution: Incomplete Assignee: Juergen Donnerstag We are happy to do so, but please let us know more precisely what to enhance. Telling us you want accessibility support and pointing us at some specs is a bit vague. > Add accessibility support > - > > Key: WICKET-982 > URL: https://issues.apache.org/jira/browse/WICKET-982 > Project: Wicket > Issue Type: New Feature > Components: wicket >Reporter: James Renfro >Assignee: Juergen Donnerstag > Fix For: 1.5-M4 > > > It would be helpful to have support in Wicket specifically for programmers > looking to develop applications that are accessible to people with > disabilities. This ticket is to provide a base from which to gather specs for > that effort. > Here are some relevant links: > http://www.w3.org/TR/aria-role/ > http://www.smartlabsoftware.com/wai-validator.htm > http://www.w3.org/WAI/wcag-curric/sam119-0.htm > http://www.w3.org/WAI/ -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3161) Can not create cookies
[ https://issues.apache.org/jira/browse/WICKET-3161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931671#action_12931671 ] Hudson commented on WICKET-3161: Integrated in Apache Wicket 1.5.x #507 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.5.x/507/]) WICKET-3161: added missing apache license headers WICKET-3161: improve naming WICKET-3161: added test case WICKET-3161: cookies that are set during a buffered web response will not be transferred over redirecting. The solution to this issue is not what I consider pretty so please take time to review and feel free to improve it. Sorry for the last commit message (I intended to create a path but was clicking too fast) The previous commit is part of WICKET-3161 > Can not create cookies > -- > > Key: WICKET-3161 > URL: https://issues.apache.org/jira/browse/WICKET-3161 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.5-M3 > Environment: Windows 7, Intel i7 >Reporter: Ivaylo Stoykov >Assignee: Peter Ertl > Fix For: 1.5-M4 > > Attachments: quickstart.zip > > > Hi, > I'm migrating to wicket 1.5-M3 and I've encountered a problem. I can not > create cookies (I presume that I can't delete them either). > I've looked through the source code and this is what I found: > I add the cookie to the response and I end up with a nice > HeaderBufferingWebResponse which contains BufferedWebResponse$AddCookieAction. > But then redirectTo(Url, RequestCycle) from WebPageRenderer class is called. > Here is the method: > >private void redirectTo(Url url, RequestCycle requestCycle) > { > WebResponse response = (WebResponse)requestCycle.getResponse(); > String relativeUrl = > requestCycle.getUrlRenderer().renderUrl(url); > response.reset(); > response.sendRedirect(relativeUrl); > } > response.reset(); - removes all actions from the request. > So after this method my request has got only > BufferedWebResponse$SendRedirectAction. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3163) support building wicket offline by resolving DTD references locally
[ https://issues.apache.org/jira/browse/WICKET-3163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931678#action_12931678 ] Peter Ertl commented on WICKET-3163: Seems like this improvement was really necessary as we get timeouts on hudson quite often, e.g.: https://hudson.apache.org/hudson/job/Apache%20Wicket%201.5.x/507/org.apache.wicket$wicket Should be solved now :-) > support building wicket offline by resolving DTD references locally > --- > > Key: WICKET-3163 > URL: https://issues.apache.org/jira/browse/WICKET-3163 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 1.5-M3 >Reporter: Peter Ertl >Assignee: Peter Ertl > Fix For: 1.5-M4 > > Attachments: local-lookup.patch, LocalEntityResolver.java > > > Wicket developers, please give me some comment on this: > Some wicket test cases parse XML which refers to an external DTD. > An example is org.apache.wicket.protocol.http.WicketFilterTest > It refers to org.apache.wicket.util.file.WebXmlFile will will parse a custom > web.xml. > The web.xml will make the parser to look up > http://java.sun.com/dtd/web-app_2_3.dtd > When building wicket offline this will cause a network error and the test > will fail. > I would like to add > org.apache.wicket.util.xml.LocalEntityResolver > which may contain a set of local entitites to avoid hitting the network. > As wicket 1.5 is getting close to final I would like to get some feedback > first before putting that into trunk... > By adding this like to WebXmlFile network lookup would be avoided. > > DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); > DocumentBuilder builder = factory.newDocumentBuilder(); > builder.setEntityResolver(LocalEntityResolver.getDefault()); // no more > network lookups > Document document = builder.parse(is); > > package org.apache.wicket.util.xml; > import org.apache.wicket.util.lang.Args; > import org.xml.sax.EntityResolver; > import org.xml.sax.InputSource; > import org.xml.sax.SAXException; > import javax.servlet.Filter; > import java.io.IOException; > import java.io.InputStream; > import java.util.HashMap; > import java.util.Map; > /** > * entity resolver that tries to locate a document type definition (DTD) > using a set of custom entity resolvers > * > * @author pete > */ > public class LocalEntityResolver implements EntityResolver > { > private final Map entities = new > HashMap(3); > public static LocalEntityResolver getDefault() > { > LocalEntityResolver resolver = new LocalEntityResolver(); > > // > // look up servlet 2.3 web.xml DTD right from inside servlet-api.jar > // > resolver.put(new EntityKey("-//Sun Microsystems, Inc.//DTD Web > Application 2.3//EN", > > "http://java.sun.com/dtd/web-app_2_3.dtd";), >new ServletApiEntityLocator("web-app_2_3.dtd")); > return resolver; > } > public void put(EntityKey key, EntityLocator locator) > { > Args.notNull(key, "key"); > Args.notNull(locator, "locator"); > entities.put(key, locator); > } > public InputSource resolveEntity(String id, String url) throws > SAXException, IOException > { > for (Map.Entry entry : > entities.entrySet()) > if (entry.getKey().id.equals(id) || > entry.getKey().url.equals(url)) > return entry.getValue().locateInputSource(); > return null; > } > public static class EntityKey > { > private final String id; > private final String url; > private EntityKey(String id, String url) > { > Args.notEmpty(id, "id"); > Args.notEmpty(url, "url"); > this.id = id; > this.url = url; > } > @Override > public boolean equals(Object o) > { > if (this == o) > return true; > if (!(o instanceof EntityKey)) > return false; > EntityKey key = (EntityKey) o; > if (!id.equals(key.id)) > return false; > return url.equals(key.url); > } > @Override > public int hashCode() > { > int result = id.hashCode(); > result = 31 * result + url.hashCode
[CONF] Apache Wicket > Websites based on Wicket
Websites based on Wicket Page edited by TIMOUYAS Abdellah Changes (1) ... * *park.vodafone.cz* \- [Vodafone Park|http://park.vodafone.cz] is an social portal targeted to Vodafone carrier customers in Czech Republic. Available only in Czech for now. Developed in Wicket 1.4, Spring, Quartz, ActiveMQ, CXF and iBatis 2. * *nobrandsearch.com* \- [Search Engine Compare |http://www.nobrandsearch.com] is a blind search site which uses google guice+hibernate+Warp-Persist+Wicket. This side is for all internet users who really wants to know which search engine is actually best. You may suprise. * *OpenMQSeries* \- [OpenMQ Web site|https://sourceforge.net/projects/openmqseries/]: OpenMQSeries is a JAVA software which allows the management of MQseries Messages. it offers to the user the possibility of displaying, manipulating and managing messages in a WebSphere MQ Queue. * *Soundpure* \- [http://www.soundpure.com] e-commerce site. *Betfair Casino* \- [http://casino.betfair.com] \- Integrates Casino Third party games into Betfair platform ... Full Content (sorted alphabetically by web URL) Public Sites 1100ad.com - 1100AD Online massive multiplayer strategy game (web site on php, but the game itself on Wicket) 8vents.com - 8vents Message, Photo, File sharing service. beTurtle.com - beTurtle 'Green' social networking and information portal. cronmaker.com - CronMaker A utility to generate cron expressions. datawink.com - datawink an online chart pattern recognition search engine dbserver.ics.upjs.sk/davano - Davano Collaborative storytelling and Play-by-post-RPG supporting system. Rewritten from from PHP to Wicket+Spring+Hibernate. deect.com - Deect Multilingual dictionary, lexicon, language-learning portal Equity Market Data.com - EquityMarketData Financial Data Provider evri.com - Evri Real-time news ewmix.com - eWmix.com Brazilian e-commerce website. exerciselog.eu, trainingslog.dk, træningslog.dk - Exerciselog An exercise log for your monitoring your progress.(different sites branded a bit) fabulously40.com - Fabulously40 40+ woman's social network. Rails site gone wicket. genietown.com - GenieTown GenieTown is building a unique online community of customers and service providers. The site is designed to restore the lost experience of Main Street, where business was conducted in a personal way, the resources were local, and reputation was paramount. home-account.com - Billed as "The best way to get a mortgage loan". insidewood.lib.ncsu.edu - InsideWood InsideWood contains brief descriptions of fossil and modern woody dicots (hardwoods) from more than 200 plant families, and is searchable by an interactive, multiple-entry key. There are over 34,000 images showing anatomical details. isport.eu - iSport.eu Football (soccer) news aggregator. Uses Wicket, Spring, Hibernate and Derby, see the blog entry for details izex.ru - iZex.ru Classified site. Uses Wicket, Hibernate and AJAX uploading pictures. jalbum.net - jalbum.net Photo album hosting is Wicket and all of site was migrated from JSP. Leg Up - jWeekend A Wicket site that helps getting started quickly with Wicket, Spring, Guice, JPA, Warp, EclipseLink, Hibernate, Scala, JEE ... projects jWeekend.co.uk - jWeekend (OO & Wicket Training Courses) A Wicket site (nice/simple AJAXified cart on the "Booking" page). kinoestet.ru - KinoEstet Responses, opinions about films, and films ratings (russian language) learningpath.leapfrog.com - LeapFrog Learning Path - Learning Path helps parents interact with their child's progress on LeapFrog devices such as Tag, Leapster2, Didj, and Crammer. Mystic developed and maintains the Wicket-based application. www.leenle.com - leenle.com Sports online gaming community locator.link.co.uk/map - LINK ATM Locator Search for ATM's in the UK. Thanks to the Wicket Team and nmwael+WicketStuff for the GMap code. lomalindahealth.org/doctors - Loma Linda Physicians Search - a physicians search module for Loma Linda University Medical Center developed in Wicket and integrated with TeamSite. Developed by Mystic Loved.by - a simple way to get rewarded for your recommendations includes Facebook and Twitter integration lyhoo.com.cn - Lyhoo A personalized product search, user needs matching and alerting site in Chinese. Migrated from Spring MVC. mauswerks.net - mauswerks.net US-based ISV/ISP focused on Java application hosting, Brix CMS, and custom transactional solutions. me.dium.com - Me.dium.com Social browsing company bringing a unique experience to the online world. meetmoi.com - meetMoi (Web) meetMoi (Mobile) Location based mobile dating. memolio.com - Memolio A website to easily create and share portable photo albums called "Memolio's". Depends heavily on Wicket and Flex
[jira] Commented: (WICKET-3163) support building wicket offline by resolving DTD references locally
[ https://issues.apache.org/jira/browse/WICKET-3163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931682#action_12931682 ] Hudson commented on WICKET-3163: Integrated in Apache Wicket 1.5.x #508 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.5.x/508/]) WICKET-3163: support offline builds of wicket (avoid hitting java.sun.com for lookup of web.xml 2.3 DTD) > support building wicket offline by resolving DTD references locally > --- > > Key: WICKET-3163 > URL: https://issues.apache.org/jira/browse/WICKET-3163 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 1.5-M3 >Reporter: Peter Ertl >Assignee: Peter Ertl > Fix For: 1.5-M4 > > Attachments: local-lookup.patch, LocalEntityResolver.java > > > Wicket developers, please give me some comment on this: > Some wicket test cases parse XML which refers to an external DTD. > An example is org.apache.wicket.protocol.http.WicketFilterTest > It refers to org.apache.wicket.util.file.WebXmlFile will will parse a custom > web.xml. > The web.xml will make the parser to look up > http://java.sun.com/dtd/web-app_2_3.dtd > When building wicket offline this will cause a network error and the test > will fail. > I would like to add > org.apache.wicket.util.xml.LocalEntityResolver > which may contain a set of local entitites to avoid hitting the network. > As wicket 1.5 is getting close to final I would like to get some feedback > first before putting that into trunk... > By adding this like to WebXmlFile network lookup would be avoided. > > DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); > DocumentBuilder builder = factory.newDocumentBuilder(); > builder.setEntityResolver(LocalEntityResolver.getDefault()); // no more > network lookups > Document document = builder.parse(is); > > package org.apache.wicket.util.xml; > import org.apache.wicket.util.lang.Args; > import org.xml.sax.EntityResolver; > import org.xml.sax.InputSource; > import org.xml.sax.SAXException; > import javax.servlet.Filter; > import java.io.IOException; > import java.io.InputStream; > import java.util.HashMap; > import java.util.Map; > /** > * entity resolver that tries to locate a document type definition (DTD) > using a set of custom entity resolvers > * > * @author pete > */ > public class LocalEntityResolver implements EntityResolver > { > private final Map entities = new > HashMap(3); > public static LocalEntityResolver getDefault() > { > LocalEntityResolver resolver = new LocalEntityResolver(); > > // > // look up servlet 2.3 web.xml DTD right from inside servlet-api.jar > // > resolver.put(new EntityKey("-//Sun Microsystems, Inc.//DTD Web > Application 2.3//EN", > > "http://java.sun.com/dtd/web-app_2_3.dtd";), >new ServletApiEntityLocator("web-app_2_3.dtd")); > return resolver; > } > public void put(EntityKey key, EntityLocator locator) > { > Args.notNull(key, "key"); > Args.notNull(locator, "locator"); > entities.put(key, locator); > } > public InputSource resolveEntity(String id, String url) throws > SAXException, IOException > { > for (Map.Entry entry : > entities.entrySet()) > if (entry.getKey().id.equals(id) || > entry.getKey().url.equals(url)) > return entry.getValue().locateInputSource(); > return null; > } > public static class EntityKey > { > private final String id; > private final String url; > private EntityKey(String id, String url) > { > Args.notEmpty(id, "id"); > Args.notEmpty(url, "url"); > this.id = id; > this.url = url; > } > @Override > public boolean equals(Object o) > { > if (this == o) > return true; > if (!(o instanceof EntityKey)) > return false; > EntityKey key = (EntityKey) o; > if (!id.equals(key.id)) > return false; > return url.equals(key.url); > } > @Override > public int hashCode() > { > int result = id.hashCode(); > result = 31 * result + url.hashCode(
[jira] Closed: (WICKET-1242) IE quirks mode
[ https://issues.apache.org/jira/browse/WICKET-1242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Juergen Donnerstag closed WICKET-1242. -- Resolution: Not A Problem obviously not a problem. No discussions on that topic in the user lists > IE quirks mode > -- > > Key: WICKET-1242 > URL: https://issues.apache.org/jira/browse/WICKET-1242 > Project: Wicket > Issue Type: Improvement > Components: wicket >Affects Versions: 1.3.0-rc2 >Reporter: Juergen Donnerstag >Assignee: Juergen Donnerstag > Fix For: 1.5-M4 > > > on the one hand side we'd like to have (and some users even want the ability > to enforce it - see jira issues) that all markup files have a xml > declaration. On the other hand most current IE browser are not able to handle > is properly and switch to quirks mode which has several drawbacks. A posible > solutiion could be to > a) change our default to > getMarkupSettings().setStripXmlDeclarationFromOutput(true) > and > b) check the doc type exists and proper html tag exists. > Else log a big warning that output will force IE into quirks mode -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-3167) Strange IResourceStream type hierarchy
Strange IResourceStream type hierarchy -- Key: WICKET-3167 URL: https://issues.apache.org/jira/browse/WICKET-3167 Project: Wicket Issue Type: Improvement Components: wicket Affects Versions: 1.5-M3 Reporter: Juergen Donnerstag Priority: Minor Current type hierarchy looks like IResourceStream IStringResourceStream AbstractResourceStream AbstractStringResourceStream It propobly should rather be IResourceStream AbstractResourceStream IStringResourceStream AbstractStringResourceStream -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-466) [datetime] Make DateConverter focus on joda-time.DateTime instead of util.Date
[ https://issues.apache.org/jira/browse/WICKET-466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931708#action_12931708 ] Martin Grigorov commented on WICKET-466: "'scm' blame" shows that the code in this file is 1.5 years older than the last Eelco's comment. The used formatter is indeed Joda Time, but the input/output parameter is still j.u.Date. Maybe this is the idea - to move completely to Joda Time. > [datetime] Make DateConverter focus on joda-time.DateTime instead of util.Date > -- > > Key: WICKET-466 > URL: https://issues.apache.org/jira/browse/WICKET-466 > Project: Wicket > Issue Type: Improvement > Components: wicket-datetime >Affects Versions: 1.3.0-beta1 >Reporter: Chuck Deal >Priority: Minor > Fix For: 1.5-M4 > > Attachments: datetime.zip, datetime_patch.txt, datetime_patch.txt, > datetime_patch.txt, datetime_patch.txt, datetime_patch.txt, > quickstart-datetimeconverter.zip, wicket-datetime.patch > > > I beleive the Wicket-datetime package was designed to be used with joda-time > DateTime objects. It was also desirable to apply the "better" > parsing/toString features of DateTime to util.Date objects. To that end, the > attached patch improves the focus of the Converter to be DateTime oriented, > while still allowing the DateTextField to hold util.Dates in it's model. > The main idea of this patch is to make this package work with DateTime > objects with very little effort on the developer's part. If they want to > take advantage of the improved parsing, etc then it should take minimal > effort. > See http://www.nabble.com/-datetime--DateConverter-tf3233793.html for a brief > history of this conversation. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-3168) No Application in the thread when the web server destroys WicketFilter
No Application in the thread when the web server destroys WicketFilter -- Key: WICKET-3168 URL: https://issues.apache.org/jira/browse/WICKET-3168 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.5-M3 Reporter: Martin Grigorov Playing with Wicket 1.5 + Google AppEngine I saw this exception after modifying appengine-web.xml: WARNING: EXCEPTION org.apache.wicket.WicketRuntimeException: There is no application attached to current thread Timer-2 at org.apache.wicket.Application.get(Application.java:250) at org.apache.wicket.Session.get(Session.java:154) at org.apache.wicket.page.DefaultPageManagerContext.getSessionAttribute(DefaultPageManagerContext.java:63) at org.apache.wicket.pageStore.memory.HttpSessionDataStore.getPageTable(HttpSessionDataStore.java:130) at org.apache.wicket.pageStore.memory.HttpSessionDataStore.destroy(HttpSessionDataStore.java:116) at org.apache.wicket.pageStore.DefaultPageStore.destroy(DefaultPageStore.java:66) at org.apache.wicket.page.PersistentPageManager.destroy(PersistentPageManager.java:374) at org.apache.wicket.page.PageManagerDecorator.destroy(PageManagerDecorator.java:86) at org.apache.wicket.Application.internalDestroy(Application.java:839) at org.apache.wicket.protocol.http.WebApplication.internalDestroy(WebApplication.java:440) at org.apache.wicket.protocol.http.WicketFilter.destroy(WicketFilter.java:437) at org.mortbay.jetty.servlet.FilterHolder.destroyInstance(FilterHolder.java:127) I.e. the asynchronous thread that destroys WicketFilter has no ThreadContext thread local and thus this exception. I see two problems/solutions: 1) HttpSessionDataStore should have noop #destroy() - the Application is being destroyed, so all its http sessions will be deleted and there is no need to clean the special attribute which stores session's pages 2) WicketFilter#destroy() can set/unset the application in ThreadContext, so other functionality in all #destroy() methods will have access to the Application via Application.get() Any objections ? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3168) No Application in the thread when the web server destroys WicketFilter
[ https://issues.apache.org/jira/browse/WICKET-3168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931721#action_12931721 ] Igor Vaynberg commented on WICKET-3168: --- can this be related to WICKET-3011, a bad jetty version that runs GAE? > No Application in the thread when the web server destroys WicketFilter > -- > > Key: WICKET-3168 > URL: https://issues.apache.org/jira/browse/WICKET-3168 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.5-M3 >Reporter: Martin Grigorov > > Playing with Wicket 1.5 + Google AppEngine I saw this exception after > modifying appengine-web.xml: > WARNING: EXCEPTION > org.apache.wicket.WicketRuntimeException: There is no application attached to > current thread Timer-2 > at org.apache.wicket.Application.get(Application.java:250) > at org.apache.wicket.Session.get(Session.java:154) > at > org.apache.wicket.page.DefaultPageManagerContext.getSessionAttribute(DefaultPageManagerContext.java:63) > at > org.apache.wicket.pageStore.memory.HttpSessionDataStore.getPageTable(HttpSessionDataStore.java:130) > at > org.apache.wicket.pageStore.memory.HttpSessionDataStore.destroy(HttpSessionDataStore.java:116) > at > org.apache.wicket.pageStore.DefaultPageStore.destroy(DefaultPageStore.java:66) > at > org.apache.wicket.page.PersistentPageManager.destroy(PersistentPageManager.java:374) > at > org.apache.wicket.page.PageManagerDecorator.destroy(PageManagerDecorator.java:86) > at org.apache.wicket.Application.internalDestroy(Application.java:839) > at > org.apache.wicket.protocol.http.WebApplication.internalDestroy(WebApplication.java:440) > at > org.apache.wicket.protocol.http.WicketFilter.destroy(WicketFilter.java:437) > at > org.mortbay.jetty.servlet.FilterHolder.destroyInstance(FilterHolder.java:127) > > I.e. the asynchronous thread that destroys WicketFilter has no ThreadContext > thread local and thus this exception. > I see two problems/solutions: > 1) HttpSessionDataStore should have noop #destroy() - the Application is > being destroyed, so all its http sessions will be deleted and there is no > need to clean the special attribute which stores session's pages > 2) WicketFilter#destroy() can set/unset the application in ThreadContext, so > other functionality in all #destroy() methods will have access to the > Application via Application.get() > Any objections ? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-3168) No Application in the thread when the web server destroys WicketFilter
[ https://issues.apache.org/jira/browse/WICKET-3168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931724#action_12931724 ] Martin Grigorov commented on WICKET-3168: - Yes and No. Yes - GAE runs on Jetty. I guess older than the fixed one. No - currently WicketFilter#destroy() stack trace has no Application in the thread local, in WICKET-3011 org.apache.wicket.session.HttpSessionStore.SessionBindingListener.valueUnbound(HttpSessionBindingEvent) (i.e. Application#sessionUnbound()) will have no Application.get(). Only Application.get(String) will work because HttpSessionStore has 'applicationKey' member. I this ticket even Application.get(String) is not available for : getPageManager().destroy(); getSessionStore().destroy(); in Application#internalDestroy() because applicationKeyToApplication.remove(getApplicationKey()); is called before them. I think we should move that line at the bottom of #internalDestroy() too. > No Application in the thread when the web server destroys WicketFilter > -- > > Key: WICKET-3168 > URL: https://issues.apache.org/jira/browse/WICKET-3168 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.5-M3 >Reporter: Martin Grigorov > > Playing with Wicket 1.5 + Google AppEngine I saw this exception after > modifying appengine-web.xml: > WARNING: EXCEPTION > org.apache.wicket.WicketRuntimeException: There is no application attached to > current thread Timer-2 > at org.apache.wicket.Application.get(Application.java:250) > at org.apache.wicket.Session.get(Session.java:154) > at > org.apache.wicket.page.DefaultPageManagerContext.getSessionAttribute(DefaultPageManagerContext.java:63) > at > org.apache.wicket.pageStore.memory.HttpSessionDataStore.getPageTable(HttpSessionDataStore.java:130) > at > org.apache.wicket.pageStore.memory.HttpSessionDataStore.destroy(HttpSessionDataStore.java:116) > at > org.apache.wicket.pageStore.DefaultPageStore.destroy(DefaultPageStore.java:66) > at > org.apache.wicket.page.PersistentPageManager.destroy(PersistentPageManager.java:374) > at > org.apache.wicket.page.PageManagerDecorator.destroy(PageManagerDecorator.java:86) > at org.apache.wicket.Application.internalDestroy(Application.java:839) > at > org.apache.wicket.protocol.http.WebApplication.internalDestroy(WebApplication.java:440) > at > org.apache.wicket.protocol.http.WicketFilter.destroy(WicketFilter.java:437) > at > org.mortbay.jetty.servlet.FilterHolder.destroyInstance(FilterHolder.java:127) > > I.e. the asynchronous thread that destroys WicketFilter has no ThreadContext > thread local and thus this exception. > I see two problems/solutions: > 1) HttpSessionDataStore should have noop #destroy() - the Application is > being destroyed, so all its http sessions will be deleted and there is no > need to clean the special attribute which stores session's pages > 2) WicketFilter#destroy() can set/unset the application in ThreadContext, so > other functionality in all #destroy() methods will have access to the > Application via Application.get() > Any objections ? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (WICKET-3168) No Application in the thread when the web server destroys WicketFilter
[ https://issues.apache.org/jira/browse/WICKET-3168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931724#action_12931724 ] Martin Grigorov edited comment on WICKET-3168 at 11/13/10 3:14 PM: --- Yes and No. Yes - GAE runs on Jetty. I guess older than the fixed one. No - currently WicketFilter#destroy() stack trace has no Application in the thread local, in WICKET-3011 org.apache.wicket.session.HttpSessionStore.SessionBindingListener.valueUnbound(HttpSessionBindingEvent) (i.e. Application#sessionUnbound()) will have no Application.get(). Only Application.get(String) will work because HttpSessionStore has 'applicationKey' member. In this ticket even Application.get(String) is not available for : getPageManager().destroy(); getSessionStore().destroy(); in Application#internalDestroy() because applicationKeyToApplication.remove(getApplicationKey()); is called before them. I think we should move that line at the bottom of #internalDestroy() too. was (Author: mgrigorov): Yes and No. Yes - GAE runs on Jetty. I guess older than the fixed one. No - currently WicketFilter#destroy() stack trace has no Application in the thread local, in WICKET-3011 org.apache.wicket.session.HttpSessionStore.SessionBindingListener.valueUnbound(HttpSessionBindingEvent) (i.e. Application#sessionUnbound()) will have no Application.get(). Only Application.get(String) will work because HttpSessionStore has 'applicationKey' member. I this ticket even Application.get(String) is not available for : getPageManager().destroy(); getSessionStore().destroy(); in Application#internalDestroy() because applicationKeyToApplication.remove(getApplicationKey()); is called before them. I think we should move that line at the bottom of #internalDestroy() too. > No Application in the thread when the web server destroys WicketFilter > -- > > Key: WICKET-3168 > URL: https://issues.apache.org/jira/browse/WICKET-3168 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.5-M3 >Reporter: Martin Grigorov > > Playing with Wicket 1.5 + Google AppEngine I saw this exception after > modifying appengine-web.xml: > WARNING: EXCEPTION > org.apache.wicket.WicketRuntimeException: There is no application attached to > current thread Timer-2 > at org.apache.wicket.Application.get(Application.java:250) > at org.apache.wicket.Session.get(Session.java:154) > at > org.apache.wicket.page.DefaultPageManagerContext.getSessionAttribute(DefaultPageManagerContext.java:63) > at > org.apache.wicket.pageStore.memory.HttpSessionDataStore.getPageTable(HttpSessionDataStore.java:130) > at > org.apache.wicket.pageStore.memory.HttpSessionDataStore.destroy(HttpSessionDataStore.java:116) > at > org.apache.wicket.pageStore.DefaultPageStore.destroy(DefaultPageStore.java:66) > at > org.apache.wicket.page.PersistentPageManager.destroy(PersistentPageManager.java:374) > at > org.apache.wicket.page.PageManagerDecorator.destroy(PageManagerDecorator.java:86) > at org.apache.wicket.Application.internalDestroy(Application.java:839) > at > org.apache.wicket.protocol.http.WebApplication.internalDestroy(WebApplication.java:440) > at > org.apache.wicket.protocol.http.WicketFilter.destroy(WicketFilter.java:437) > at > org.mortbay.jetty.servlet.FilterHolder.destroyInstance(FilterHolder.java:127) > > I.e. the asynchronous thread that destroys WicketFilter has no ThreadContext > thread local and thus this exception. > I see two problems/solutions: > 1) HttpSessionDataStore should have noop #destroy() - the Application is > being destroyed, so all its http sessions will be deleted and there is no > need to clean the special attribute which stores session's pages > 2) WicketFilter#destroy() can set/unset the application in ThreadContext, so > other functionality in all #destroy() methods will have access to the > Application via Application.get() > Any objections ? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-3162) NPE when the underlaying model changed and ajax re-appear.
[ https://issues.apache.org/jira/browse/WICKET-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Vaynberg resolved WICKET-3162. --- Resolution: Invalid Assignee: Igor Vaynberg your border uses AjaxFallbackLink. when you right click the link and do "open in new tab" it creates a regular request in which case the ajaxrequesttarget inside link's onclick will be null (like the javadoc explains), but your code doesnt check for it. other check for the target or use a regular non-fallback ajax link. > NPE when the underlaying model changed and ajax re-appear. > --- > > Key: WICKET-3162 > URL: https://issues.apache.org/jira/browse/WICKET-3162 > Project: Wicket > Issue Type: Bug >Affects Versions: 1.4.13 > Environment: wicket 1.4.13 >Reporter: smallufo >Assignee: Igor Vaynberg > Attachments: CommentsPanel.html, CommentsPanel.java, Dao.java, > DaoImpl.java, HomePage.html, HomePage.java, PulldownBorder.html, > PulldownBorder.java, quickstart.zip, WicketApplication.java > > Original Estimate: 0h > Remaining Estimate: 0h > > Hi , I have a simple panel , with a border and a listView : > > > > //comment layout > > > > And the code : > add(border); > ListView commentsView = new ListView("commentsView" , new > LoadableDetachableModel>() > { > @Override > protected List load() { > return commentDao.getComments(0 , 10); > } > }) > { > @Override > protected void populateItem(ListItem item) { > //comment layout > } > }; > border.add(commentsView); > commentsView.setReuseItems(false); > The Panel has a border , with a clickable button , can be used to > collapse/expand the content of the border with AJAX. > Here is my steps : > 1. I first collapse the panel . > 2. Then open another browser panel , add a comment. (the underlaying data > model is changed) > 3. Back to the original panel , expand the panel ... > And I got a NPE : > 2010-11-12 05:19:12,661 ERROR wicket.RequestCycle - Exception in rendering > component: [MarkupContainer [Component id = _body]] > org.apache.wicket.WicketRuntimeException: Exception in rendering component: > [MarkupContainer [Component id = _body]] > at org.apache.wicket.Component.renderComponent(Component.java:2725) > at > org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538) > at org.apache.wicket.Component.render(Component.java:2517) > at > org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1440) > at > org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603) > at > org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527) > at org.apache.wicket.Component.renderComponent(Component.java:2686) > at > org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538) > ... > Caused by: java.lang.NullPointerException > at > org.apache.wicket.markup.html.border.Border$BorderBodyContainer.onComponentTagBody(Border.java:375) > at org.apache.wicket.Component.renderComponent(Component.java:2686) > ... 45 more > > > Igor replied : > s/border.add(commentsView);/border.getbodycontainer().add(commentsView);/ > I replied : > I tried , but NPE is still thrown , with the same stacktrace... > Is there anything I missed ? > Here is my border's HTML : > > > > border's java code : > content = new WebMarkupContainer("content"); > > content.setOutputMarkupPlaceholderTag(true); > content.setVisible(defaultExpanded); > content.setRenderBodyOnly(false); > add(content); > content.add(getBodyContainer()); > and the ajax link's onClick() : > Link collapseExpandLink = new > AjaxFallbackLink("collapseExpandLink") > { > @Override > public void onClick(AjaxRequestTarget target) > { > expanded=!expanded; > content.setVisible(expanded); > target.addComponent(content); > } > }; > add(collapseExpandLink); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r1034939 - in /wicket/branches/wicket-1.4.x/wicket/src: main/java/org/apache/wicket/Component.java test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_ajax_expected.html
Author: ivaynberg Date: Sun Nov 14 06:20:28 2010 New Revision: 1034939 URL: http://svn.apache.org/viewvc?rev=1034939&view=rev Log: hieararchy checks should test parent first Issue: WICKET-3166 Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java wicket/branches/wicket-1.4.x/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_ajax_expected.html Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java?rev=1034939&r1=1034938&r2=1034939&view=diff == --- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java (original) +++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java Sun Nov 14 06:20:28 2010 @@ -2210,19 +2210,13 @@ public abstract class Component implemen */ public final boolean isVisibleInHierarchy() { - Component component = this; - while (component != null) + Component parent = getParent(); + if (parent != null && !parent.isVisibleInHierarchy()) { - if (component.determineVisibility()) - { - component = component.getParent(); - } - else - { - return false; - } + return false; } - return true; + + return determineVisibility(); } /** @@ -3546,9 +3540,9 @@ public abstract class Component implemen { if (!tag.getName().equalsIgnoreCase(name)) { - String msg = String.format("Component [%s] (path = [%s]) must be " + -"applied to a tag of type [%s], not: %s", - getId(), getPath(), name, tag.toUserDebugString()); + String msg = String.format("Component [%s] (path = [%s]) must be " + + "applied to a tag of type [%s], not: %s", getId(), getPath(), name, + tag.toUserDebugString()); findMarkupStream().throwMarkupException(msg); } @@ -3574,9 +3568,9 @@ public abstract class Component implemen final String tagAttributeValue = tag.getAttributes().getString(key); if (tagAttributeValue == null || !value.equalsIgnoreCase(tagAttributeValue)) { - String msg = String.format("Component [%s] (path = [%s]) must be applied to a tag " + -"with [%s] attribute matching [%s], not [%s]", - getId(), getPath(), key, value, tagAttributeValue); + String msg = String.format("Component [%s] (path = [%s]) must be applied to a tag " + + "with [%s] attribute matching [%s], not [%s]", getId(), getPath(), key, + value, tagAttributeValue); findMarkupStream().throwMarkupException(msg); } @@ -4693,14 +4687,14 @@ public abstract class Component implemen Boolean state = getMetaData(ENABLED_IN_HIERARCHY_CACHE_KEY); if (state == null) { - state = isEnabled() && isEnableAllowed(); - if (state) + Component parent = getParent(); + if (parent != null && !parent.isEnabledInHierarchy()) { - Component parent = getParent(); - if (parent != null) - { - state = state && parent.isEnabledInHierarchy(); - } + state = false; + } + else + { + state = isEnabled() && isEnableAllowed(); } setMetaData(ENABLED_IN_HIERARCHY_CACHE_KEY, state); } Modified: wicket/branches/wicket-1.4.x/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_ajax_expected.html URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_ajax_expected.html?rev=1034939&r1=1034938&r2=1034939&v
[jira] Assigned: (WICKET-3166) isVisibleInHierarchy() possibly unnecessarily checks children whose parents are invisible?
[ https://issues.apache.org/jira/browse/WICKET-3166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Vaynberg reassigned WICKET-3166: - Assignee: Igor Vaynberg > isVisibleInHierarchy() possibly unnecessarily checks children whose parents > are invisible? > -- > > Key: WICKET-3166 > URL: https://issues.apache.org/jira/browse/WICKET-3166 > Project: Wicket > Issue Type: Bug >Affects Versions: 1.4.13 >Reporter: Martin Makundi >Assignee: Igor Vaynberg > Attachments: diff.txt, Wicket-Quickstart.zip > > Original Estimate: 1h > Remaining Estimate: 1h > > Hi! > See attached quickstart with junit test reproducing the bug. See also patch > proposal. > I have a page with two panels: > page.form.add(panel1); > page.form.add(panel2); > in some situations panel1 is not visible. > However, a form submit event will visit all formcomponents of panel1 via: >at > org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder(FormComponent.java:400) >at > org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(Form.java:1209) >at org.apache.wicket.markup.html.form.Form.inputChanged(Form.java:1403) >at > org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:865) > This results in a crash because panel1 components are not prepared to > be invoked via isvisible when the panel itself is not visible. > I wonder if the component.isVisibleInHierarchy could be changed as > follows, to first check parent visibility: > public final boolean isVisibleInHierarchy() > { >Component component = this; >while (component != null) >{ > Component componentParent = component.getParent(); > if (((componentParent == null) || > componentParent.isVisibleInHierarchy()) && > component.determineVisibility()) > { >component = componentParent; > } > else > { >return false; > } >} >return true; > } > Similar change could/should maybe be possible also for isEnabledInHierarchy ? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r1034941 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java
Author: ivaynberg Date: Sun Nov 14 06:31:09 2010 New Revision: 1034941 URL: http://svn.apache.org/viewvc?rev=1034941&view=rev Log: Issue: WICKET-3166 Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java?rev=1034941&r1=1034940&r2=1034941&view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java Sun Nov 14 06:31:09 2010 @@ -2138,19 +2138,12 @@ public abstract class Component */ public final boolean isVisibleInHierarchy() { - Component component = this; - while (component != null) + Component parent = getParent(); + if (parent != null && !parent.isVisibleInHierarchy()) { - if (component.determineVisibility()) - { - component = component.getParent(); - } - else - { - return false; - } + return false; } - return true; + return determineVisibility(); } /** @@ -4252,14 +4245,14 @@ public abstract class Component Boolean state = getMetaData(ENABLED_IN_HIERARCHY_CACHE_KEY); if (state == null) { - state = isEnabled() && isEnableAllowed(); - if (state) + Component parent = getParent(); + if (parent != null && !parent.isEnabledInHierarchy()) { - Component parent = getParent(); - if (parent != null) - { - state = state && parent.isEnabledInHierarchy(); - } + state = false; + } + else + { + state = isEnabled() && isEnableAllowed(); } setMetaData(ENABLED_IN_HIERARCHY_CACHE_KEY, state); }
[jira] Resolved: (WICKET-3166) isVisibleInHierarchy() possibly unnecessarily checks children whose parents are invisible?
[ https://issues.apache.org/jira/browse/WICKET-3166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Vaynberg resolved WICKET-3166. --- Resolution: Fixed Fix Version/s: 1.5-M4 1.4.14 > isVisibleInHierarchy() possibly unnecessarily checks children whose parents > are invisible? > -- > > Key: WICKET-3166 > URL: https://issues.apache.org/jira/browse/WICKET-3166 > Project: Wicket > Issue Type: Bug >Affects Versions: 1.4.13 >Reporter: Martin Makundi >Assignee: Igor Vaynberg > Fix For: 1.4.14, 1.5-M4 > > Attachments: diff.txt, Wicket-Quickstart.zip > > Original Estimate: 1h > Remaining Estimate: 1h > > Hi! > See attached quickstart with junit test reproducing the bug. See also patch > proposal. > I have a page with two panels: > page.form.add(panel1); > page.form.add(panel2); > in some situations panel1 is not visible. > However, a form submit event will visit all formcomponents of panel1 via: >at > org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder(FormComponent.java:400) >at > org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(Form.java:1209) >at org.apache.wicket.markup.html.form.Form.inputChanged(Form.java:1403) >at > org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:865) > This results in a crash because panel1 components are not prepared to > be invoked via isvisible when the panel itself is not visible. > I wonder if the component.isVisibleInHierarchy could be changed as > follows, to first check parent visibility: > public final boolean isVisibleInHierarchy() > { >Component component = this; >while (component != null) >{ > Component componentParent = component.getParent(); > if (((componentParent == null) || > componentParent.isVisibleInHierarchy()) && > component.determineVisibility()) > { >component = componentParent; > } > else > { >return false; > } >} >return true; > } > Similar change could/should maybe be possible also for isEnabledInHierarchy ? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r1034946 - in /wicket/trunk: wicket-request/src/main/java/org/apache/wicket/request/http/ wicket/src/main/java/org/apache/wicket/protocol/http/ wicket/src/main/java/org/apache/wicket/proto
Author: ivaynberg Date: Sun Nov 14 07:14:24 2010 New Revision: 1034946 URL: http://svn.apache.org/viewvc?rev=1034946&view=rev Log: some more cleanup, mainly better naming Issue: WICKET-3161 Added: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/IMetaDataBufferingWebResponse.java - copied, changed from r1034939, wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/ICookieSavingResponse.java Removed: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/ICookieSavingResponse.java Modified: wicket/trunk/wicket-request/src/main/java/org/apache/wicket/request/http/WebResponse.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/BufferedWebResponse.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/HeaderBufferingWebResponse.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/mock/MockHttpServletResponse.java wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java Modified: wicket/trunk/wicket-request/src/main/java/org/apache/wicket/request/http/WebResponse.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-request/src/main/java/org/apache/wicket/request/http/WebResponse.java?rev=1034946&r1=1034945&r2=1034946&view=diff == --- wicket/trunk/wicket-request/src/main/java/org/apache/wicket/request/http/WebResponse.java (original) +++ wicket/trunk/wicket-request/src/main/java/org/apache/wicket/request/http/WebResponse.java Sun Nov 14 07:14:24 2010 @@ -32,6 +32,7 @@ import org.apache.wicket.util.time.Durat */ public abstract class WebResponse extends Response { + /** Recommended value for cache duration */ // one year, maximum recommended cache duration in RFC-2616 public static final Duration MAX_CACHE_DURATION = Duration.days(365); @@ -173,14 +174,14 @@ public abstract class WebResponse extend /** * Make this response cacheable -* +* * @param duration -*maximum duration before the response must be invalidated by any caches. -*It should not exceed one year, based on -*http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html";>RFC-2616. +*maximum duration before the response must be invalidated by any caches. It should +*not exceed one year, based on http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html";>RFC-2616. * @param scope *controls which caches are allowed to cache the response -* +* * @see WebResponse#MAX_CACHE_DURATION */ public void enableCaching(Duration duration, WebResponse.CacheScope scope) @@ -189,7 +190,7 @@ public abstract class WebResponse extend Args.notNull(scope, "scope"); // do not exceed the maximum recommended value from RFC-2616 - if(duration.compareTo(MAX_CACHE_DURATION) > 0) + if (duration.compareTo(MAX_CACHE_DURATION) > 0) duration = MAX_CACHE_DURATION; // Get current time @@ -208,30 +209,29 @@ public abstract class WebResponse extend /** * caching scope for data * -* Unless the data is confidential, session-specific or user-specific the general advice is -* to prefer value PUBLIC for best network performance. +* Unless the data is confidential, session-specific or user-specific the general advice is to +* prefer value PUBLIC for best network performance. * -* This value will basically affect the header [Cache-Control]. Details can be found -* http://palisade.plynt.com/issues/2008Jul/cache-control-attributes";>here -* or in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html";>RFC-2616. +* This value will basically affect the header [Cache-Control]. Details can be found http://palisade.plynt.com/issues/2008Jul/cache-control-attributes";>here or in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html";>RFC-2616. */ - public static enum CacheScope - { + public static enum CacheScope { /** * use all caches (private + public) * -* Use this value for caching if the data is not confidential or session-specific. It will allow -* public caches to cache the data. In some versions of Firefox this will enable caching -* of resources over SSL (details can be found -* http://blog.pluron.com/2008/07/why-you-should.html";>here). +* Use this value for caching if the data is not confidential or session-specific. It will +* allow public caches to cache the data. In some versions of Firefox this will enable +
svn commit: r1034948 - in /wicket/branches/wicket-1.4.x/wicket/src: main/java/org/apache/wicket/PageMap.java main/java/org/apache/wicket/Session.java test/java/org/apache/wicket/PageMapTest.java
Author: ivaynberg Date: Sun Nov 14 07:19:10 2010 New Revision: 1034948 URL: http://svn.apache.org/viewvc?rev=1034948&view=rev Log: Issue: WICKET-3108 Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/PageMap.java wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Session.java wicket/branches/wicket-1.4.x/wicket/src/test/java/org/apache/wicket/PageMapTest.java Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/PageMap.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/PageMap.java?rev=1034948&r1=1034947&r2=1034948&view=diff == --- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/PageMap.java (original) +++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/PageMap.java Sun Nov 14 07:19:10 2010 @@ -346,11 +346,14 @@ public abstract class PageMap implements } /** -* +* Marking this PageMap as the most recently used only if it isn't already removed from session. */ protected final void dirty() { - Session.get().dirtyPageMap(this); + if (Session.get().getPageMaps().contains(this)) + { + Session.get().dirtyPageMap(this); + } } /** Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Session.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Session.java?rev=1034948&r1=1034947&r2=1034948&view=diff == --- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Session.java (original) +++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Session.java Sun Nov 14 07:19:10 2010 @@ -19,6 +19,7 @@ package org.apache.wicket; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -351,8 +352,8 @@ public abstract class Session implements */ private transient Map temporarySessionAttributes; - /** A linked list for last used pagemap queue */ - private final LinkedList/* */ usedPageMaps = new LinkedList(); + /** A linked list for last used pagemap names queue */ + private final LinkedList usedPageMapNames = new LinkedList(); /** * Constructor. Note that {...@link RequestCycle} is not available until this constructor returns. @@ -705,7 +706,7 @@ public abstract class Session implements IPageMap pageMap = pageMapForName(pageMapName, pageMapName == PageMap.DEFAULT_NAME); if (pageMap != null) { - synchronized (usedPageMaps) // get a lock so be sure that only one + synchronized (usedPageMapNames) // get a lock so be sure that only one // is made { if (pageMapsUsedInRequest == null) @@ -809,10 +810,24 @@ public abstract class Session implements list.add((IPageMap)getAttribute(attribute)); } } + Collections.sort(list, new LruComparator()); return list; } /** +* Sorting page maps respecting the least recently used sequence. +*/ + private class LruComparator implements Comparator + { + public int compare(IPageMap pg1, IPageMap pg2) + { + Integer pg1Index = usedPageMapNames.indexOf(pg1.getName()); + Integer pg2Index = usedPageMapNames.indexOf(pg2.getName()); + return pg1Index.compareTo(pg2Index); + } + } + + /** * @return Size of this session, including all the pagemaps it contains */ public final long getSizeInBytes() @@ -919,18 +934,26 @@ public abstract class Session implements { // Check that session doesn't have too many page maps already, if so, evict final int maxPageMaps = getApplication().getSessionSettings().getMaxPageMaps(); - synchronized (usedPageMaps) + synchronized (usedPageMapNames) { - while (usedPageMaps.size() >= maxPageMaps) + List usedPageMaps = getPageMaps(); + int excessPagemaps = (usedPageMaps.size() + 1) - maxPageMaps;/* + * plus 1 meaning t
[jira] Resolved: (WICKET-3160) Session causing memory leak after WICKET-3108
[ https://issues.apache.org/jira/browse/WICKET-3160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Vaynberg resolved WICKET-3160. --- Resolution: Fixed Fix Version/s: 1.4.14 Assignee: Igor Vaynberg > Session causing memory leak after WICKET-3108 > - > > Key: WICKET-3160 > URL: https://issues.apache.org/jira/browse/WICKET-3160 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.4.13 >Reporter: Pedro Santos >Assignee: Igor Vaynberg > Fix For: 1.4.14 > > Attachments: fix-test-WICKET-3160-cleanup.patch, > fix-test-WICKET-3160-maintainingLruSequence.patch, > fix-test-WICKET-3160.patch, fix-WICKET-3108-memory-leak.patch > > > Session has a not transient variable storing used pagemaps causing memory > leak. Pagemap objects are already maintained by the session store object. > Please see more info at https://issues.apache.org/jira/browse/WICKET-3108 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-3156) Submitting button of a multiple-button form is not resolved correctly
[ https://issues.apache.org/jira/browse/WICKET-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Vaynberg resolved WICKET-3156. --- Resolution: Cannot Reproduce Assignee: Igor Vaynberg please attach a quickstart demonstrating the problem > Submitting button of a multiple-button form is not resolved correctly > - > > Key: WICKET-3156 > URL: https://issues.apache.org/jira/browse/WICKET-3156 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.5-M3 >Reporter: Ivan Vasilev >Assignee: Igor Vaynberg > Attachments: test-WICKET-3156.patch > > > This bug affects Form.findSubmittingButton(). > Inside it all the form submitting children of the page are visited. A check > is made whether the current form submitting component is a child of the > current form. > If so another check is performed: > if ((!parameters.getParameterValue(name).isNull()) || > !parameters.getParameterValue(name + ".x").isNull()) > I saw that in case of a button the condition > !parameters.getParameterValue(name).isNull()) is true (returns the "value" > attribute of the button), so the button can be considered the submitting > component of the form. > However if there are multiple buttons in the form in this case the first > visited button will be returned, which is not necessary the one that actually > submitted the form. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r1034949 - /wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/WebPage.java
Author: ivaynberg Date: Sun Nov 14 07:45:25 2010 New Revision: 1034949 URL: http://svn.apache.org/viewvc?rev=1034949&view=rev Log: pages with instantiated url compressors are considered stateful Issue: WICKET-3155 Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/WebPage.java Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/WebPage.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/WebPage.java?rev=1034949&r1=1034948&r2=1034949&view=diff == --- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/WebPage.java (original) +++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/WebPage.java Sun Nov 14 07:45:25 2010 @@ -294,6 +294,7 @@ public class WebPage extends Page implem if (compressor == null) { compressor = new UrlCompressor(); + setStatelessHint(false); } return compressor; }
[jira] Resolved: (WICKET-3155) Stateless forms don't work when using UrlCompressingWebRequestProcessor
[ https://issues.apache.org/jira/browse/WICKET-3155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Vaynberg resolved WICKET-3155. --- Resolution: Won't Fix Assignee: Igor Vaynberg i dont think having url compressors in a static map is a good idea because they contain weak references to components, which may potentially allow for state-sharing between sessions. im not sure this is a case we can properly support. urlcompressor has always been an experimental feature which was never fully flushed out. i made it so that pages that have a compressor are no longer considered stateless, which of course wont help you much :| not sure if we can support this usecase. > Stateless forms don't work when using UrlCompressingWebRequestProcessor > --- > > Key: WICKET-3155 > URL: https://issues.apache.org/jira/browse/WICKET-3155 > Project: Wicket > Issue Type: Bug > Components: wicket >Affects Versions: 1.4.12 >Reporter: Arnout Engelen >Assignee: Igor Vaynberg > Attachments: fix-WICKET-3155.patch, test-WICKET-3155.patch > > > When my Application has: > @Override > protected IRequestCycleProcessor newRequestCycleProcessor() > { > return new UrlCompressingWebRequestProcessor(); > } > This breaks submitting a stateless form: > WicketMessage: unable to find component with path 1 on stateless page [Page > class = nl.topicuszorg.ksyos.txcs.web.TxcsUzipasLoginPage, id = 4, version = > 0] it could be that the component is inside a repeater make your component > return false in getStatelessHint() > Root cause: > org.apache.wicket.WicketRuntimeException: unable to find component with path > 1 on stateless page [Page class = > nl.topicuszorg.ksyos.txcs.web.TxcsUzipasLoginPage, id = 4, version = 0] it > could be that the component is inside a repeater make your component return > false in getStatelessHint() > at > org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:148) > at > org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) > at > org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250) > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) > at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) > at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) > at > org.apache.wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:160) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) > at > org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) > at nl.topicuszorg.wicket.filter.CacheFilter.doFilter(CacheFilter.java:96) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) > at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) > at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) > at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) > at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) > at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) > at > org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) > at > org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) > at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) > at org.mortbay.jetty.Server.handle(Server.java:326) > at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) > at > org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943) > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) > at > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) > at > org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue