[jira] Commented: (WICKET-12) open Modal Window without AjaxRequestTarget
[ https://issues.apache.org/jira/browse/WICKET-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12597057#action_12597057 ] Maurice Marrink commented on WICKET-12: --- I recently needed modalwindow to open up on a normal request too, here is what i did: private static final class ScreenSaverWindow extends ModalWindow { private static final long serialVersionUID = 1L; private static final Logger log = LoggerFactory.getLogger(ScreenSaverWindow.class); private transient Field showField; private boolean renderScript = false; /** * @param id */ @SuppressWarnings(unchecked) public ScreenSaverWindow(String id) { super(id); initShowField(); } /** * */ private void initShowField() { try { showField = ModalWindow.class.getDeclaredField(shown); showField.setAccessible(true); } catch (SecurityException e) { log.error(e.getMessage(), e); } catch (NoSuchFieldException e) { log.error(e.getMessage(), e); } } /** * @see org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow#onBeforeRender() */ @Override protected void onBeforeRender() { if (SoundScapeSession.getSoundScapeSession().isScreensaverEnabled() !isShown()) show(); boolean shown = isShown(); super.onBeforeRender(); // fix stupid parent behavior for non ajax requests if (shown !isShown()) { show(); get(getContentId()).setVisible(true); renderScript = true; } } /** * @see org.apache.wicket.markup.html.panel.Panel#renderHead(org.apache.wicket.markup.html.internal.HtmlHeaderContainer) */ @Override public void renderHead(HtmlHeaderContainer container) { super.renderHead(container); // hack to open modal window in non ajax requests too if (renderScript) { try { Method m = ModalWindow.class.getDeclaredMethod(getWindowOpenJavascript); m.setAccessible(true); String script = (String) m.invoke(this); // hack to disable onclose warning for just this window container.getHeaderResponse().renderOnDomReadyJavascript(script); } catch (SecurityException e) { log.error(e.getMessage(), e); } catch (NoSuchMethodException e) { log.error(e.getMessage(), e); } catch (IllegalArgumentException e) { log.error(e.getMessage(), e); } catch (IllegalAccessException e) { log.error(e.getMessage(), e); } catch (InvocationTargetException e) { log.error(e.getMessage(), e); } renderScript = false; } } /** * shows this modaldialog. */ private void show() { try { if (showField == null) initShowField
[jira] Commented: (WICKET-12) open Modal Window without AjaxRequestTarget
[ https://issues.apache.org/jira/browse/WICKET-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12597065#action_12597065 ] Maurice Marrink commented on WICKET-12: --- Lets wait till Matej had his say about this :) open Modal Window without AjaxRequestTarget --- Key: WICKET-12 URL: https://issues.apache.org/jira/browse/WICKET-12 Project: Wicket Issue Type: Improvement Components: wicket Affects Versions: 1.2.6, 1.3.0-beta1, 2.0 branch (discontinued) Reporter: J.W. Janssen Assignee: Maurice Marrink Fix For: 1.5-M1 Wicket 1.2.2 included a new Modal Window component. However, this component can only be used with a valid AjaxRequestTarget. It would be useful if Modal Windows could be opened programmatically at any time without an AjaxRequestTarget. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r655498 - in /wicket: branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/ branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/inte
Author: marrink Date: Mon May 12 06:30:16 2008 New Revision: 655498 URL: http://svn.apache.org/viewvc?rev=655498view=rev Log: RESOLVED - issue WICKET-1292: WicketTester continueToOriginalDestination() uses application home page instead of original redictor https://issues.apache.org/jira/browse/WICKET-1292 Fixed scenario where original destination is the homepage of the application Added: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/intercept/ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/intercept/HomePage.html (with props) wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/intercept/HomePage.java (with props) wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/intercept/InterceptPage.html (with props) wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/intercept/InterceptPage.java (with props) wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/intercept/InterceptTest.java (with props) wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/intercept/TargetPage.html (with props) wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/intercept/TargetPage.java (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/redirect/intercept/ wicket/trunk/wicket/src/test/java/org/apache/wicket/redirect/intercept/HomePage.html (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/redirect/intercept/HomePage.java (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/redirect/intercept/InterceptPage.html (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/redirect/intercept/InterceptPage.java (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/redirect/intercept/InterceptTest.java (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/redirect/intercept/TargetPage.html (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/redirect/intercept/TargetPage.java (with props) Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java?rev=655498r1=655497r2=655498view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java Mon May 12 06:30:16 2008 @@ -19,7 +19,9 @@ import java.io.File; import java.util.Enumeration; import java.util.HashMap; +import java.util.Iterator; import java.util.Map; +import java.util.TreeSet; import javax.servlet.FilterConfig; import javax.servlet.ServletContext; @@ -28,17 +30,21 @@ import org.apache.wicket.Application; import org.apache.wicket.Component; +import org.apache.wicket.IPageMap; import org.apache.wicket.IRequestTarget; import org.apache.wicket.Page; import org.apache.wicket.PageParameters; import org.apache.wicket.Session; import org.apache.wicket.markup.html.pages.ExceptionErrorPage; import org.apache.wicket.protocol.http.request.WebErrorCodeResponseTarget; +import org.apache.wicket.protocol.http.request.WebRequestCodingStrategy; +import org.apache.wicket.request.target.coding.WebRequestEncoder; import org.apache.wicket.request.target.component.BookmarkablePageRequestTarget; import org.apache.wicket.request.target.component.IBookmarkablePageRequestTarget; import org.apache.wicket.request.target.component.IPageRequestTarget; import org.apache.wicket.settings.IRequestCycleSettings; import org.apache.wicket.util.file.WebApplicationPath; +import org.apache.wicket.util.string.AppendingStringBuffer; import org.apache.wicket.util.tester.BaseWicketTester; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -374,7 +380,70 @@ BaseWicketTester.callOnBeginRequest(cycle); BookmarkablePageRequestTarget requestTarget = new BookmarkablePageRequestTarget( pageClass, params); - if (application.getHomePage() != null) + if (pageClass == application.getHomePage()) + { + // special handling + + // code
svn commit: r655308 - in /wicket: branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/ branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ branches/wic
Author: marrink Date: Sun May 11 05:05:31 2008 New Revision: 655308 URL: http://svn.apache.org/viewvc?rev=655308view=rev Log: RESOLVED - issue WICKET-1292: WicketTester continueToOriginalDestination() uses application home page instead of original redictor https://issues.apache.org/jira/browse/WICKET-1292 Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest.java wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/link/BookmarkablePageLinkTest.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java wicket/trunk/wicket/src/test/java/org/apache/wicket/SetResponsePageTest.java wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/link/BookmarkablePageLinkTest.java Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java?rev=655308r1=655307r2=655308view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java Sun May 11 05:05:31 2008 @@ -372,7 +372,19 @@ try { BaseWicketTester.callOnBeginRequest(cycle); - cycle.request(new BookmarkablePageRequestTarget(pageClass, params)); + BookmarkablePageRequestTarget requestTarget = new BookmarkablePageRequestTarget( + pageClass, params); + if (application.getHomePage() != null) + { + String url = cycle.urlFor(requestTarget).toString(); + String path = application.getClass().getName(); + path = path.substring(path.lastIndexOf('.') + 1); + path = / + path + / + path + /; + getServletRequest().setURL(path + url); + } + else + log.warn(The application does not have a HomePage, this might cause problems or unexpected behavior); + cycle.request(requestTarget); } finally { Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest.java?rev=655308r1=655307r2=655308view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest.java Sun May 11 05:05:31 2008 @@ -29,9 +29,10 @@ { WicketTester tester = new WicketTester(Page1.class); tester.setupRequestAndResponse(); - tester.getServletRequest() - .setURL(?wicket:bookmarkablePage=: + Page1.class.getName() + ); - tester.processRequestCycle(); +// tester.getServletRequest() +// .setURL(?wicket:bookmarkablePage=: + Page1.class.getName() + ); +// tester.processRequestCycle(); + tester.startPage(Page1.class); tester.assertRenderedPage(Page3.class); tester.destroy(); } Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/link/BookmarkablePageLinkTest.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/link/BookmarkablePageLinkTest.java?rev=655308r1=655307r2=655308view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/link/BookmarkablePageLinkTest.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/link/BookmarkablePageLinkTest.java Sun May 11 05:05:31 2008 @@ -18,8 +18,6 @@ import org.apache.wicket.PageParameters; import org.apache.wicket.WicketTestCase; -import org.apache.wicket.protocol.http.WebRequestCycle; -import org.apache.wicket.request.target.component.BookmarkablePageRequestTarget; /** * @author jcompagner @@ -42,19
[jira] Resolved: (WICKET-1292) WicketTester continueToOriginalDestination() uses application home page instead of original redictor
[ https://issues.apache.org/jira/browse/WICKET-1292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink resolved WICKET-1292. - Resolution: Fixed Fix Version/s: 1.4-M2 WicketTester continueToOriginalDestination() uses application home page instead of original redictor Key: WICKET-1292 URL: https://issues.apache.org/jira/browse/WICKET-1292 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.0-final Reporter: Lauri Piispanen Assignee: Maurice Marrink Priority: Minor Fix For: 1.3.4, 1.4-M2 Attachments: HomePage.html, HomePage.java, InterceptPage.html, InterceptPage.java, InterceptPageTestCase.java, MyApplication.java, TargetPage.html, TargetPage.java WicketTester continues to application home page when continueToOriginalDestination() is called, instead of the expected original destination. Attached is a test case to reproduce the issue. In servlet environment continueToOriginalDestination() works correctly. --- Workaround by Maurice Marrink: // continueToOriginaldestination does not work if there is no url available, so we need to fake one here(testing only hack) mock.setupRequestAndResponse(); WebRequestCycle cycle = mock.createRequestCycle(); String url1 = cycle.urlFor(new BookmarkablePageRequestTarget(YOUR_PAGE_HERE.class, null)).toString(); mock.getServletRequest().setURL(/GeneralTest$1/GeneralTest$1/ + url1); mock.processRequestCycle(); --- mock is the WicketTester. GeneralTest$1 from the url is the classname of your application without the package. (in my case it is an anonymous inner class hence the $1) Note that this classname appears twice in the url. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-1558) WicketTester.startPage(page) throws No requestCycle is currently set
[ https://issues.apache.org/jira/browse/WICKET-1558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink resolved WICKET-1558. - Resolution: Fixed Verified with 1.3.3, however the wicket 1.3 branch does not have this problem anymore (1.3.4). Nor does trunk (1.4-m2) WicketTester.startPage(page) throws No requestCycle is currently set -- Key: WICKET-1558 URL: https://issues.apache.org/jira/browse/WICKET-1558 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.3 Environment: Eclipse 3.3.1.1 on Ubuntu 7.10 Reporter: Federico Fanton Assignee: Maurice Marrink Priority: Minor Fix For: 1.3.4 Attachments: testreqcycle.zip I'm receiving a strange message with WicketTester in 1.3.3.. Whenever I use startPage(Page) I get a there was an error cleaning up target [EMAIL PROTECTED] class = org.apache.wicket.util.tester.DummyHomePage, id = 1, version = 0]-testPage-interface org.apache.wicket.markup.html.link.ILinkListener.ILinkListener (request paramaters: [RequestParameters componentPath=1:testPage pageMapName=null versionNumber=0 interfaceName=ILinkListener componentId=null behaviorId=null urlDepth=-1 parameters={} onlyProcessIfPathActive=false]). followed by No requestcycle is currently set! To reproduce, just use a QuickStart with a completely static Homepage.html (no wicket:id's) and an empty Homepage.class (just a Homepage extends WebPage), while the test itself is new WicketTester().startPage(new HomePage()); with log4j.logger.org.apache.wicket=DEBUG inside log4j.properties, to enable logging. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r655028 - /wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Initializer.java
Author: marrink Date: Sat May 10 01:37:47 2008 New Revision: 655028 URL: http://svn.apache.org/viewvc?rev=655028view=rev Log: as requested by igor: IActivePageBehaviorListener Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Initializer.java Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Initializer.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Initializer.java?rev=655028r1=655027r2=655028view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Initializer.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Initializer.java Sat May 10 01:37:47 2008 @@ -16,6 +16,7 @@ */ package org.apache.wicket; +import org.apache.wicket.behavior.IActivePageBehaviorListener; import org.apache.wicket.behavior.IBehaviorListener; import org.apache.wicket.markup.html.form.IFormSubmitListener; import org.apache.wicket.markup.html.form.IOnChangeListener; @@ -42,6 +43,7 @@ IOnChangeListener.INTERFACE.register(); IRedirectListener.INTERFACE.register(); IResourceListener.INTERFACE.register(); + IActivePageBehaviorListener.INTERFACE.register(); } /**
svn commit: r652559 - in /wicket: branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/ branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/ trunk/wicket/src
Author: marrink Date: Thu May 1 08:41:23 2008 New Revision: 652559 URL: http://svn.apache.org/viewvc?rev=652559view=rev Log: RESOLVED - issue WICKET-1575: AjaxEventBehavior does not check for component.isEnableAllowed before adding the ajax event to the tag https://issues.apache.org/jira/browse/WICKET-1575 Added: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.html (with props) wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.java (with props) wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledTest.java (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.html (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.java (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledTest.java (with props) Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java?rev=652559r1=652558r2=652559view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java Thu May 1 08:41:23 2008 @@ -16,6 +16,7 @@ */ package org.apache.wicket.ajax; +import org.apache.wicket.Component; import org.apache.wicket.IClusterable; import org.apache.wicket.markup.ComponentTag; import org.apache.wicket.util.string.Strings; @@ -103,7 +104,8 @@ super.onComponentTag(tag); // only add the event handler when the component is enabled. - if (getComponent().isEnabled()) + Component myComponent = getComponent(); + if (myComponent.isEnabled() myComponent.isEnableAllowed()) { tag.put(event, getEventHandler()); } Added: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.html URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.html?rev=652559view=auto == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.html (added) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.html Thu May 1 08:41:23 2008 @@ -0,0 +1,11 @@ +!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; +html xmlns=http://www.w3.org/1999/xhtml; +head +meta http-equiv=Content-Type content=text/html; charset=UTF-8 / +titleInsert title here/title +/head +body + span wicket:id=enabled/span + span wicket:id=disabled/span +/body +/html \ No newline at end of file Propchange: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.html -- svn:mime-type = text/plain Added: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.java?rev=652559view=auto == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.java (added) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxBehaviorEnabledPage.java Thu May 1 08:41:23 2008 @@ -0,0 +1,60 @@ +/* + * 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
[jira] Resolved: (WICKET-1575) AjaxEventBehavior does not check for component.isEnableAllowed before adding the ajax event to the tag
[ https://issues.apache.org/jira/browse/WICKET-1575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink resolved WICKET-1575. - Resolution: Fixed AjaxEventBehavior does not check for component.isEnableAllowed before adding the ajax event to the tag -- Key: WICKET-1575 URL: https://issues.apache.org/jira/browse/WICKET-1575 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.2, 1.3.3, 1.3.4, 1.4-M1 Reporter: Maurice Marrink Assignee: Maurice Marrink Fix For: 1.3.4, 1.4-M2 Currently AjaxEventBehavior only checks component.isEnabled before applying the ajax event to the tag. This could result in an UnauthorizedActionException when the ajax event is received by wicket. The behavior should also check for component.isEnableAllowed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r652652 - in /wicket: branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/ branches/wicket-1.3.x/jdk-1.5/wicket-auth-role
Author: marrink Date: Thu May 1 13:33:45 2008 New Revision: 652652 URL: http://svn.apache.org/viewvc?rev=652652view=rev Log: RESOLVED - issue WICKET-1152: MetaDataRoleAuthorizationStrategy.unauthorize() doesn't work https://issues.apache.org/jira/browse/WICKET-1152 Added: wicket/trunk/wicket-auth-roles/src/test/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissionsTest.java (with props) Modified: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissions.java wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissions.java wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/test/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissionsTest.java wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/test/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissionsTest.java wicket/trunk/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissions.java wicket/trunk/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissions.java wicket/trunk/wicket-auth-roles/src/test/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissionsTest.java Modified: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissions.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissions.java?rev=652652r1=652651r2=652652view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissions.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissions.java Thu May 1 13:33:45 2008 @@ -102,7 +102,9 @@ } /** -* Remove the given authorized role from an action. +* Remove the given authorized role from an action. Note that this is only relevant if a role +* was previously authorized for that action. If no roles where previously authorized the effect +* of the unauthorize call is that no roles at all will be authorized for that action. * * @param action *The action @@ -126,11 +128,16 @@ { roles.removeAll(rolesToRemove); } + else + { + roles = new Roles(); + rolesForAction.put(action, roles); + } // If we removed the last authorized role, we authorize the empty role // so that removing authorization can't suddenly open something up to // everyone. - if (roles != null roles.size() == 0) + if (roles.size() == 0) { roles.add(MetaDataRoleAuthorizationStrategy.NO_ROLE); } Modified: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissions.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissions.java?rev=652652r1=652651r2=652652view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissions.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissions.java Thu May 1 13:33:45 2008 @@ -105,7 +105,10 @@ } /** -* Removes permission for the given role to instantiate the given class. +* Removes permission for the given role to instantiate the given class. Note that this is only +* relevant if a role was previously authorized for that class. If no roles where previously +* authorized the effect of the unauthorize call is that no roles at all will be authorized for +* that class. * * @param componentClass *The class @@ -125,16 +128,21 @@ throw new IllegalArgumentException(Argument rolesToRemove cannot be null); } - final
[jira] Resolved: (WICKET-1152) MetaDataRoleAuthorizationStrategy.unauthorize() doesn't work
[ https://issues.apache.org/jira/browse/WICKET-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink resolved WICKET-1152. - Resolution: Fixed Fix Version/s: 1.4-M2 1.3.4 unauthorize now has the effect of removing an authorized role (if previously authorized) or denying authorization for every role if there are no remaining authorized roles. MetaDataRoleAuthorizationStrategy.unauthorize() doesn't work Key: WICKET-1152 URL: https://issues.apache.org/jira/browse/WICKET-1152 Project: Wicket Issue Type: Bug Components: wicket-auth-roles Affects Versions: 1.3.0-rc1 Reporter: David Assignee: Maurice Marrink Fix For: 1.3.4, 1.4-M2 Attachments: wicket-1152.patch Original Estimate: 0h Remaining Estimate: 0h Try this: MetaDataRoleAuthorizationStrategy.unauthorize(this, RENDER, USER); The page will still be rendered for user with USER role. The following will work fine to prevent rendering by anybody: MetaDataRoleAuthorizationStrategy.authorize(this, RENDER, ); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-1575) AjaxEventBehavior does not check for component.isEnableAllowed before adding the ajax event to the tag
AjaxEventBehavior does not check for component.isEnableAllowed before adding the ajax event to the tag -- Key: WICKET-1575 URL: https://issues.apache.org/jira/browse/WICKET-1575 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.3, 1.3.2 Reporter: Maurice Marrink Assignee: Maurice Marrink Fix For: 1.3.4, 1.4-M1 Currently AjaxEventBehavior only checks component.isEnabled before applying the ajax event to the tag. This could result in an UnauthorizedActionException when the ajax event is received by wicket. The behavior should also check for component.isEnableAllowed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-1575) AjaxEventBehavior does not check for component.isEnableAllowed before adding the ajax event to the tag
[ https://issues.apache.org/jira/browse/WICKET-1575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink updated WICKET-1575: Affects Version/s: 1.4-M1 1.3.4 Fix Version/s: (was: 1.4-M1) 1.4-M2 AjaxEventBehavior does not check for component.isEnableAllowed before adding the ajax event to the tag -- Key: WICKET-1575 URL: https://issues.apache.org/jira/browse/WICKET-1575 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.2, 1.3.3, 1.3.4, 1.4-M1 Reporter: Maurice Marrink Assignee: Maurice Marrink Fix For: 1.3.4, 1.4-M2 Currently AjaxEventBehavior only checks component.isEnabled before applying the ajax event to the tag. This could result in an UnauthorizedActionException when the ajax event is received by wicket. The behavior should also check for component.isEnableAllowed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-1575) AjaxEventBehavior does not check for component.isEnableAllowed before adding the ajax event to the tag
[ https://issues.apache.org/jira/browse/WICKET-1575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink resolved WICKET-1575. - Resolution: Fixed AjaxEventBehavior does not check for component.isEnableAllowed before adding the ajax event to the tag -- Key: WICKET-1575 URL: https://issues.apache.org/jira/browse/WICKET-1575 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.2, 1.3.3, 1.3.4, 1.4-M1 Reporter: Maurice Marrink Assignee: Maurice Marrink Fix For: 1.3.4, 1.4-M2 Currently AjaxEventBehavior only checks component.isEnabled before applying the ajax event to the tag. This could result in an UnauthorizedActionException when the ajax event is received by wicket. The behavior should also check for component.isEnableAllowed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Reopened: (WICKET-1575) AjaxEventBehavior does not check for component.isEnableAllowed before adding the ajax event to the tag
[ https://issues.apache.org/jira/browse/WICKET-1575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink reopened WICKET-1575: - commits can't be made at this time due to infra structure problems. AjaxEventBehavior does not check for component.isEnableAllowed before adding the ajax event to the tag -- Key: WICKET-1575 URL: https://issues.apache.org/jira/browse/WICKET-1575 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.2, 1.3.3, 1.3.4, 1.4-M1 Reporter: Maurice Marrink Assignee: Maurice Marrink Fix For: 1.3.4, 1.4-M2 Currently AjaxEventBehavior only checks component.isEnabled before applying the ajax event to the tag. This could result in an UnauthorizedActionException when the ajax event is received by wicket. The behavior should also check for component.isEnableAllowed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-1152) MetaDataRoleAuthorizationStrategy.unauthorize() doesn't work
[ https://issues.apache.org/jira/browse/WICKET-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink updated WICKET-1152: Fix Version/s: (was: 1.3.4) Remaining Estimate: 0h Original Estimate: 0h I can reproduce this with the following testcase (see bottom). However judging by the code this behavior was never intended. the method unauthorize might be better named removePreviouslyGrantedAuthorization. I will discuss this on the list. public void testRemove2() { WicketTester tester = new WicketTester(); tester.setupRequestAndResponse(); Label label = new Label(label, text); Action mambo = new Action(mambo); MetaDataRoleAuthorizationStrategy strategy = new MetaDataRoleAuthorizationStrategy( new IRoleCheckingStrategy() { public boolean hasAnyRole(Roles roles) { return false; } }); label.setMetaData(MetaDataRoleAuthorizationStrategy.ACTION_PERMISSIONS, new ActionPermissions()); MetaDataRoleAuthorizationStrategy.unauthorize(label, mambo, johan); assertFalse(strategy.isActionAuthorized(label, mambo)); tester.processRequestCycle(); tester.destroy(); } MetaDataRoleAuthorizationStrategy.unauthorize() doesn't work Key: WICKET-1152 URL: https://issues.apache.org/jira/browse/WICKET-1152 Project: Wicket Issue Type: Bug Components: wicket-auth-roles Affects Versions: 1.3.0-rc1 Reporter: David Assignee: Maurice Marrink Original Estimate: 0h Remaining Estimate: 0h Try this: MetaDataRoleAuthorizationStrategy.unauthorize(this, RENDER, USER); The page will still be rendered for user with USER role. The following will work fine to prevent rendering by anybody: MetaDataRoleAuthorizationStrategy.authorize(this, RENDER, ); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r651383 - in /wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src: main/java/org/apache/wicket/authorization/strategies/role/metadata/ test/java/org/apache/wicket/authorization/stra
Author: marrink Date: Thu Apr 24 13:13:13 2008 New Revision: 651383 URL: http://svn.apache.org/viewvc?rev=651383view=rev Log: OPEN - issue WICKET-1152: MetaDataRoleAuthorizationStrategy.unauthorize() doesn't work https://issues.apache.org/jira/browse/WICKET-1152 Need to decide if we are going to support this usecase. Fixed a nullpointer too Added: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/test/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissionsTest.java (with props) Modified: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissions.java wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissions.java wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/test/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissionsTest.java Modified: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissions.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissions.java?rev=651383r1=651382r2=651383view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissions.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissions.java Thu Apr 24 13:13:13 2008 @@ -130,7 +130,7 @@ // If we removed the last authorized role, we authorize the empty role // so that removing authorization can't suddenly open something up to // everyone. - if (roles.size() == 0) + if (roles != null roles.size() == 0) { roles.add(MetaDataRoleAuthorizationStrategy.NO_ROLE); } Modified: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissions.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissions.java?rev=651383r1=651382r2=651383view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissions.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/main/java/org/apache/wicket/authorization/strategies/role/metadata/InstantiationPermissions.java Thu Apr 24 13:13:13 2008 @@ -134,7 +134,7 @@ // If we removed the last authorized role, we authorize the empty role // so that removing authorization can't suddenly open something up to // everyone. - if (roles.size() == 0) + if (roles != null roles.size() == 0) { roles.add(MetaDataRoleAuthorizationStrategy.NO_ROLE); } Modified: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/test/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissionsTest.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/test/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissionsTest.java?rev=651383r1=651382r2=651383view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/test/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissionsTest.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.5/wicket-auth-roles/src/test/java/org/apache/wicket/authorization/strategies/role/metadata/ActionPermissionsTest.java Thu Apr 24 13:13:13 2008 @@ -65,4 +65,45 @@ permissions.authorizeAll(mambo); assertEquals(null, permissions.rolesFor(mambo)); } + + /** +* Test adding roles. +* +* @throws Exception +*/ + public void testRemove1() throws Exception + { + ActionPermissions permissions = new ActionPermissions(); + Action mambo = new Action(mambo); + assertEquals(null, permissions.rolesFor(mambo)); + permissions.unauthorize(mambo, new Roles(maurice)); + assertEquals(null, permissions.rolesFor(mambo
[jira] Updated: (WICKET-1152) MetaDataRoleAuthorizationStrategy.unauthorize() doesn't work
[ https://issues.apache.org/jira/browse/WICKET-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink updated WICKET-1152: Attachment: wicket-1152.patch This is the patch i applied to the 1.3 branch, so that we may later apply it to trunk also. MetaDataRoleAuthorizationStrategy.unauthorize() doesn't work Key: WICKET-1152 URL: https://issues.apache.org/jira/browse/WICKET-1152 Project: Wicket Issue Type: Bug Components: wicket-auth-roles Affects Versions: 1.3.0-rc1 Reporter: David Assignee: Maurice Marrink Attachments: wicket-1152.patch Original Estimate: 0h Remaining Estimate: 0h Try this: MetaDataRoleAuthorizationStrategy.unauthorize(this, RENDER, USER); The page will still be rendered for user with USER role. The following will work fine to prevent rendering by anybody: MetaDataRoleAuthorizationStrategy.authorize(this, RENDER, ); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r650231 - in /wicket: branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/ branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/protocol/http
Author: marrink Date: Mon Apr 21 12:33:58 2008 New Revision: 650231 URL: http://svn.apache.org/viewvc?rev=650231view=rev Log: RESOLVED - issue WICKET-1527: WicketTester can not deal with null values in page parameters https://issues.apache.org/jira/browse/WICKET-1527 Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/protocol/http/WebRequestTest.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/WebRequestTest.java Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java?rev=650231r1=650230r2=650231view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java Mon Apr 21 12:33:58 2008 @@ -687,9 +687,11 @@ { final String name = (String)iterator.next(); final String value = parameters.getString(name); - buf.append(URLEncoder.encode(name, UTF-8)); + if (name != null) + buf.append(URLEncoder.encode(name, UTF-8)); buf.append('='); - buf.append(URLEncoder.encode(value, UTF-8)); + if (value != null) + buf.append(URLEncoder.encode(value, UTF-8)); if (iterator.hasNext()) { buf.append(''); Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/protocol/http/WebRequestTest.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/protocol/http/WebRequestTest.java?rev=650231r1=650230r2=650231view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/protocol/http/WebRequestTest.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/protocol/http/WebRequestTest.java Mon Apr 21 12:33:58 2008 @@ -86,7 +86,7 @@ mockRequest.setRequestToRedirectString(?a=1a=2); Object obj = mockRequest.getParameterMap().get(a); assertTrue(Expected + new String[0].getClass() + , got + obj.getClass(), - obj instanceof String[]); + obj instanceof String[]); } /** @@ -108,5 +108,29 @@ WebRequest webRequest = new ServletWebRequest(mockRequest); assertEquals(isAjax, webRequest.isAjax()); + } + + /** +* Test handling of null parameter values. +*/ + public void testNullHandling() + { + MockHttpServletRequest mockRequest = tester.getServletRequest(); + mockRequest.setParameter(a, null); + assertNull(mockRequest.getAttribute(a)); + assertEquals(a=, mockRequest.getQueryString()); + } + + /** +* Test handling of null parameter keys. +*/ + public void testNullHandling2() + { + MockHttpServletRequest mockRequest = tester.getServletRequest(); + mockRequest.setRequestToRedirectString(?=m); // key is encoded as empty string + assertEquals(=m, mockRequest.getQueryString()); + mockRequest.setParameter(null, m2); // force null string + assertEquals(=m2=m, mockRequest.getQueryString()); + } } Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java?rev=650231r1=650230r2=650231view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java Mon
[jira] Resolved: (WICKET-1527) WicketTester can not deal with null values in page parameters
[ https://issues.apache.org/jira/browse/WICKET-1527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink resolved WICKET-1527. - Resolution: Fixed Fix Version/s: 1.4-M1 Proposed solution applied WicketTester can not deal with null values in page parameters - Key: WICKET-1527 URL: https://issues.apache.org/jira/browse/WICKET-1527 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.0-final Reporter: Hugo Hallman Assignee: Maurice Marrink Priority: Minor Fix For: 1.3.4, 1.4-M1 A NullPointerException is thrown when the wicketTester is used to render a page with a null value in the page parameters, and the page is trying to get the url of the request. java.lang.NullPointerException at java.net.URLEncoder.encode(Unknown Source) at org.apache.wicket.protocol.http.MockHttpServletRequest.getQueryString(MockHttpServletRequest.java:691) at org.apache.wicket.protocol.http.servlet.ServletWebRequest.getURL(ServletWebRequest.java:368) at page.constructor(); or myproject.requestcycle.detach(); at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1263) at org.apache.wicket.RequestCycle.request(RequestCycle.java:489) at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:382) at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:370) at org.apache.wicket.util.tester.BaseWicketTester.executeListener(BaseWicketTester.java:248) at org.apache.wicket.util.tester.BaseWicketTester.clickLink(BaseWicketTester.java:765) at org.apache.wicket.util.tester.BaseWicketTester.clickLink(BaseWicketTester.java:617) at myproject.test(); The failing code looks like: final String name = (String)iterator.next(); final String value = parameters.getString(name); buf.append(URLEncoder.encode(name, UTF-8)); buf.append('='); buf.append(URLEncoder.encode(value, UTF-8)); and fails in URLEncoder.encode(value, utf8). A proposed solution is to check for null values in the parameter value. I have not been able to test a later release than 1.3.0, but by inspection, the same problem still exists. http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java?view=markup This behaviour is inconsistent with the runtime outside of tester. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-1527) WicketTester can not deal with null values in page parameters
[ https://issues.apache.org/jira/browse/WICKET-1527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12591025#action_12591025 ] Maurice Marrink commented on WICKET-1527: - ofcourse, how stupid of me. Thanks Frank :) Maurice On Mon, Apr 21, 2008 at 9:59 PM, Frank Bille Jensen (JIRA) WicketTester can not deal with null values in page parameters - Key: WICKET-1527 URL: https://issues.apache.org/jira/browse/WICKET-1527 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.0-final Reporter: Hugo Hallman Assignee: Maurice Marrink Priority: Minor Fix For: 1.3.4, 1.4-M2 A NullPointerException is thrown when the wicketTester is used to render a page with a null value in the page parameters, and the page is trying to get the url of the request. java.lang.NullPointerException at java.net.URLEncoder.encode(Unknown Source) at org.apache.wicket.protocol.http.MockHttpServletRequest.getQueryString(MockHttpServletRequest.java:691) at org.apache.wicket.protocol.http.servlet.ServletWebRequest.getURL(ServletWebRequest.java:368) at page.constructor(); or myproject.requestcycle.detach(); at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1263) at org.apache.wicket.RequestCycle.request(RequestCycle.java:489) at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:382) at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:370) at org.apache.wicket.util.tester.BaseWicketTester.executeListener(BaseWicketTester.java:248) at org.apache.wicket.util.tester.BaseWicketTester.clickLink(BaseWicketTester.java:765) at org.apache.wicket.util.tester.BaseWicketTester.clickLink(BaseWicketTester.java:617) at myproject.test(); The failing code looks like: final String name = (String)iterator.next(); final String value = parameters.getString(name); buf.append(URLEncoder.encode(name, UTF-8)); buf.append('='); buf.append(URLEncoder.encode(value, UTF-8)); and fails in URLEncoder.encode(value, utf8). A proposed solution is to check for null values in the parameter value. I have not been able to test a later release than 1.3.0, but by inspection, the same problem still exists. http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java?view=markup This behaviour is inconsistent with the runtime outside of tester. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r648797 - /wicket/branches/wicket-1.3.x/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/authentication/MyAuthenticatedWebSession.java
Author: marrink Date: Wed Apr 16 12:23:28 2008 New Revision: 648797 URL: http://svn.apache.org/viewvc?rev=648797view=rev Log: fix deprecated 2 arg constructor Modified: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/authentication/MyAuthenticatedWebSession.java Modified: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/authentication/MyAuthenticatedWebSession.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/authentication/MyAuthenticatedWebSession.java?rev=648797r1=648796r2=648797view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/authentication/MyAuthenticatedWebSession.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.5/wicket-examples/src/main/java/org/apache/wicket/examples/authentication/MyAuthenticatedWebSession.java Wed Apr 16 12:23:28 2008 @@ -17,7 +17,6 @@ package org.apache.wicket.examples.authentication; import org.apache.wicket.Request; -import org.apache.wicket.authentication.AuthenticatedWebApplication; import org.apache.wicket.authentication.AuthenticatedWebSession; import org.apache.wicket.authorization.strategies.role.Roles; @@ -32,14 +31,12 @@ /** * Construct. * -* @param application -*The application * @param request *The current request object */ - public MyAuthenticatedWebSession(final AuthenticatedWebApplication application, Request request) + public MyAuthenticatedWebSession(Request request) { - super(application, request); + super(request); } /**
svn commit: r648812 - /wicket/trunk/wicket-examples/.tomcatplugin
Author: marrink Date: Wed Apr 16 12:43:07 2008 New Revision: 648812 URL: http://svn.apache.org/viewvc?rev=648812view=rev Log: fix tomcat classpath (for those of us using the eclipse tomcat plugin) Modified: wicket/trunk/wicket-examples/.tomcatplugin Modified: wicket/trunk/wicket-examples/.tomcatplugin URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/.tomcatplugin?rev=648812r1=648811r2=648812view=diff == Binary files - no diff available.
svn commit: r648813 - /wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/authentication/MyAuthenticatedWebSession.java
Author: marrink Date: Wed Apr 16 12:43:23 2008 New Revision: 648813 URL: http://svn.apache.org/viewvc?rev=648813view=rev Log: fix deprecated 2 arg constructor Modified: wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/authentication/MyAuthenticatedWebSession.java Modified: wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/authentication/MyAuthenticatedWebSession.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/authentication/MyAuthenticatedWebSession.java?rev=648813r1=648812r2=648813view=diff == --- wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/authentication/MyAuthenticatedWebSession.java (original) +++ wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/authentication/MyAuthenticatedWebSession.java Wed Apr 16 12:43:23 2008 @@ -17,7 +17,6 @@ package org.apache.wicket.examples.authentication; import org.apache.wicket.Request; -import org.apache.wicket.authentication.AuthenticatedWebApplication; import org.apache.wicket.authentication.AuthenticatedWebSession; import org.apache.wicket.authorization.strategies.role.Roles; @@ -32,14 +31,12 @@ /** * Construct. * -* @param application -*The application * @param request *The current request object */ - public MyAuthenticatedWebSession(final AuthenticatedWebApplication application, Request request) + public MyAuthenticatedWebSession(Request request) { - super(application, request); + super(request); } /**
svn commit: r648815 - /wicket/branches/wicket-1.3.x/jdk-1.5/wicket-examples/.tomcatplugin
Author: marrink Date: Wed Apr 16 12:45:17 2008 New Revision: 648815 URL: http://svn.apache.org/viewvc?rev=648815view=rev Log: fix tomcat classpath (for those of us using the eclipse tomcat plugin) Modified: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-examples/.tomcatplugin Modified: wicket/branches/wicket-1.3.x/jdk-1.5/wicket-examples/.tomcatplugin URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.5/wicket-examples/.tomcatplugin?rev=648815r1=648814r2=648815view=diff == Binary files - no diff available.
[jira] Resolved: (WICKET-1418) org.apache.wicket.MarkupContainer swallows AbortException
[ https://issues.apache.org/jira/browse/WICKET-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink resolved WICKET-1418. - Resolution: Fixed Fix Version/s: 1.3.4 fixed in 1.3.4 and 1.4 m1 org.apache.wicket.MarkupContainer swallows AbortException - Key: WICKET-1418 URL: https://issues.apache.org/jira/browse/WICKET-1418 Project: Wicket Issue Type: Bug Components: wicket Reporter: Peter Ertl Assignee: Maurice Marrink Fix For: 1.3.4 Attachments: bugtest.zip, wicket-1418-pertl.patch, wicket-patch, wicket133.patch MarkupContainer#onBeforeRenderChildren() will catch exceptions of type org.apache.wicket.AbortException and remap them to a WicketRuntimeException. This is obviously wrong. For example when throwing a RestartResponseException the exception will be remapped to WicketRuntimeException and the response will not be restarted but the error page will be shown. I attached a usecase to demonstrate this bug. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r647561 - in /wicket: branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/ trunk/wicke
Author: marrink Date: Sun Apr 13 04:28:39 2008 New Revision: 647561 URL: http://svn.apache.org/viewvc?rev=647561view=rev Log: RESOLVED - issue WICKET-1418: org.apache.wicket.MarkupContainer swallows AbortException https://issues.apache.org/jira/browse/WICKET-1418 Tests Submitted by: Peter Ertl Added: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.html (with props) wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.java (with props) wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionTest.java (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/redirect/abort/ wicket/trunk/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.html (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.java (with props) wicket/trunk/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionTest.java (with props) Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java wicket/trunk/wicket/src/main/java/org/apache/wicket/RequestCycle.java Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java?rev=647561r1=647560r2=647561view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java Sun Apr 13 04:28:39 2008 @@ -1262,6 +1262,19 @@ } catch (RuntimeException e) { + /* +* check if the raised exception wraps an abort exception. if so, it is probably wise to +* unwrap and rethrow the abort exception +*/ + Throwable cause = e.getCause(); + while (cause != null) + { + if (cause instanceof AbortException) + { + throw ((AbortException)cause); + } + cause = cause.getCause(); + } if (!handlingException) { // set step manually to handle exception Added: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.html URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.html?rev=647561view=auto == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.html (added) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.html Sun Apr 13 04:28:39 2008 @@ -0,0 +1,13 @@ +?xml version=1.0 encoding=UTF-8? +!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; +html xmlns:wicket=http://wicket.apache.org; +head + meta http-equiv=Content-Type content=text/html;charset=UTF-8/ + titlePage/title +/head +body + + span wicket:id=testtest/span + +/body +/html \ No newline at end of file Propchange: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.html -- svn:mime-type = text/plain Added: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.java?rev=647561view=auto == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.java (added) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/abort/AbortExceptionPage.java Sun Apr 13 04:28:39 2008 @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work
[jira] Updated: (WICKET-1418) org.apache.wicket.MarkupContainer swallows AbortException
[ https://issues.apache.org/jira/browse/WICKET-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink updated WICKET-1418: Attachment: wicket133.patch Igor's patch can not be applied to wicket 1.33, this patch contains the same changes for wicket 1.33. additionally it contains the testcase provided by peter ertl as a junit testcase. org.apache.wicket.MarkupContainer swallows AbortException - Key: WICKET-1418 URL: https://issues.apache.org/jira/browse/WICKET-1418 Project: Wicket Issue Type: Bug Components: wicket Reporter: Peter Ertl Assignee: Igor Vaynberg Attachments: bugtest.zip, wicket-1418-pertl.patch, wicket-patch, wicket133.patch MarkupContainer#onBeforeRenderChildren() will catch exceptions of type org.apache.wicket.AbortException and remap them to a WicketRuntimeException. This is obviously wrong. For example when throwing a RestartResponseException the exception will be remapped to WicketRuntimeException and the response will not be restarted but the error page will be shown. I attached a usecase to demonstrate this bug. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r646046 [2/3] - in /wicket/trunk: ./ archetypes/quickstart/.settings/ jdk-1.4/ jdk-1.4/wicket-datetime/ jdk-1.4/wicket-datetime/.settings/ jdk-1.4/wicket-extensions/ jdk-1.4/wicket-extensi
Modified: wicket/trunk/jdk-1.4/wicket-spring/.settings/org.eclipse.jdt.core.prefs URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-spring/.settings/org.eclipse.jdt.core.prefs?rev=646046r1=646045r2=646046view=diff == --- wicket/trunk/jdk-1.4/wicket-spring/.settings/org.eclipse.jdt.core.prefs (original) +++ wicket/trunk/jdk-1.4/wicket-spring/.settings/org.eclipse.jdt.core.prefs Tue Apr 8 12:31:33 2008 @@ -1,323 +1,323 @@ -#Sun Jul 01 09:58:45 PDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.uad,*.ucd,*.uld,*.upd,*.udd,*.uod,*.usd,*.utd,*.uud,*.odd,*.ead,*.ecd,*.eld,*.epd,*.edd,*.eod,*.esd,*.etd,*.eud,*.urd*.uml2,*.ecore,,*.launch -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=ignore -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private +#Tue Apr 08 20:19:32 CEST 2008 +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
[jira] Resolved: (WICKET-1291) WicketTester Doesn't Support setDefaultFormProcessing(false)
[ https://issues.apache.org/jira/browse/WICKET-1291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink resolved WICKET-1291. - Resolution: Fixed Fix Version/s: (was: 1.3.4) Checking for defaultformprocessing is an option however the real culprit was a check that excluded all buttons from the form, which prevented the form from finding the submit button. WicketTester Doesn't Support setDefaultFormProcessing(false) Key: WICKET-1291 URL: https://issues.apache.org/jira/browse/WICKET-1291 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.0-final Reporter: Brandon Fuller Assignee: Maurice Marrink Priority: Minor I was trying to use the WicketTester to click the button for an AjaxFallbackButton that has setDefaultFormProcessing(false). So I wanted to execute the onclick for the component, like this: tester.executeAjaxEvent(meetingForm:inputForm:rootViewPanel:addOrganization, onclick); What seems to happen is that the pages tries to update all the form fields and perform validation. This is incorrect in the context for the setDefaultFormProcessing(false) behavior. I was looking at the source for BaseWicketTester and noticed that in executeAjaxEvent(), it always tries to submit the form if the behavior is a AjaxFormSubmitBehavior. This wouldn't be correct in the case of when you set setDefaultFormProcessing(false) on the button. I think it needs to check for setDefaultFormProcessing at that point. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r645708 - in /wicket/trunk/jdk-1.4/wicket/src: main/java/org/apache/wicket/util/tester/ test/java/org/apache/wicket/ajax/form/
Author: marrink Date: Mon Apr 7 15:02:10 2008 New Revision: 645708 URL: http://svn.apache.org/viewvc?rev=645708view=rev Log: RESOLVED - issue WICKET-1291: WicketTester Doesn't Support setDefaultFormProcessing(false) https://issues.apache.org/jira/browse/WICKET-1291 Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTest.java (with props) wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTestPage.html (with props) wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTestPage.java (with props) Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java?rev=645708r1=645707r2=645708view=diff == --- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java Mon Apr 7 15:02:10 2008 @@ -44,7 +44,6 @@ import org.apache.wicket.feedback.FeedbackMessages; import org.apache.wicket.feedback.IFeedbackMessageFilter; import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.markup.html.form.CheckGroup; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.FormComponent; @@ -1227,7 +1226,8 @@ { public void onFormComponent(FormComponent formComponent) { - if (!(formComponent instanceof Button) !(formComponent instanceof RadioGroup) + // !(formComponent instanceof Button) + if (!(formComponent instanceof RadioGroup) !(formComponent instanceof CheckGroup)) { String name = formComponent.getInputName(); Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTest.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTest.java?rev=645708view=auto == --- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTest.java (added) +++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTest.java Mon Apr 7 15:02:10 2008 @@ -0,0 +1,68 @@ +/* + * 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.ajax.form; + +import org.apache.wicket.WicketTestCase; +import org.apache.wicket.util.tester.FormTester; + +/** + * Test case for WICKET-1291 + * + * @see a href=https://issues.apache.org/jira/browse/WICKET-1291;WICKET-1291/a + * @author marrink + */ +public class AjaxFormSubmitTest extends WicketTestCase +{ + + /** +* @see org.apache.wicket.WicketTestCase#setUp() +*/ + protected void setUp() throws Exception + { + super.setUp(); + } + + /** +* @see org.apache.wicket.WicketTestCase#tearDown() +*/ + protected void tearDown() throws Exception + { + super.tearDown(); + } + + /** +* Test ajax form submit without default form processing. +*/ + public void testSubmitNoDefProcessing() + { + Class pageClass = AjaxFormSubmitTestPage.class; + System.out.println(=== + pageClass.getName() + ===); + + tester.startPage(pageClass); + tester.assertRenderedPage(pageClass); + FormTester form = tester.newFormTester(form); + form.setValue(txt1, txt1); + form.setValue(txt2, txt2
JiraStuff Commented: (WSWASP-5) ContainerSecurityCheck does not work with inherit action
[ http://wicketstuff.org/jira/browse/WSWASP-5?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_10431 ] Maurice Marrink commented on WSWASP-5: -- Just committed a preliminary version where this should be fixed. It needs some more testing but should be backwards compatible with the previous implementation. ContainerSecurityCheck does not work with inherit action Key: WSWASP-5 URL: http://wicketstuff.org/jira/browse/WSWASP-5 Project: WicketStuff WASP Issue Type: Bug Components: Secure Components Affects Versions: 1.3.0 Reporter: Maurice Marrink Assigned To: Maurice Marrink Fix For: 1.3.1 I deployed the examples and they worked fine...however, after some investigation, I wanted to see if I could create a SecurePanel that would contain a SecureTextField and basically do some simple modifications to the example apps to get a better ie a how security implemented in WASP works. The panel shows up fine when a user is authorized to view the page. When the panel contains a normal text field, the user can see it. When it contains a 'SecureTextField', it doesn't appear. I would assume that the child component (SecureTextField) would also appear (inheriting parent permissions). We basically want to have various panels in our application that would allow users to view and/or edit content based on the 'inherit, render, enable' permissions. Again, I took the tabs example and created a 'SecurePanel' which appears fine if the user is authorized. It simply contains a SecureTextField which does not appear. I'm assuming that this component would inherit the permissions from its parent so if the user has priviliges to view the parent, they will also see the child. If I change the 'SecureTextField' to a normal 'TextField', it works fine. TestPanel is just another panel on a new SecuredTab that I created. grant principal org.apache.wicket.security.examples.authorization.MyPrincipal super { permission ${ComponentPermission} org.apache.wicket.security.examples.tabs.panels.Heineken, render, enable; permission ${ComponentPermission} org.apache.wicket.security.examples.tabs.panels.Grolsch, render, enable; //issue with SecureTextField not showing up permission ${ComponentPermission} org.apache.wicket.security.examples.tabs.panels.TestPanel, inherit, render, enable; }; TestPanel.java ... /** * Construct. * * @param id */ public TestPanel(String id) { super(id); add(new Label(name, getName())); add(new MultiLineLabel(description, getDescription()).setEscapeModelStrings(false)); add(new ExternalLink(link, getUrl())); //Does not show up! add(new org.apache.wicket.security.components.markup.html.form.SecureTextField(secureTextField)); } ... } thank you, Chris -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://wicketstuff.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
JiraStuff Created: (WSWASP-5) ContainerSecurityCheck does not work with inherit action
ContainerSecurityCheck does not work with inherit action Key: WSWASP-5 URL: http://wicketstuff.org/jira/browse/WSWASP-5 Project: WicketStuff WASP Issue Type: Bug Components: Secure Components Affects Versions: 1.3.0 Reporter: Maurice Marrink Assigned To: Maurice Marrink Fix For: 1.3.1 I deployed the examples and they worked fine...however, after some investigation, I wanted to see if I could create a SecurePanel that would contain a SecureTextField and basically do some simple modifications to the example apps to get a better ie a how security implemented in WASP works. The panel shows up fine when a user is authorized to view the page. When the panel contains a normal text field, the user can see it. When it contains a 'SecureTextField', it doesn't appear. I would assume that the child component (SecureTextField) would also appear (inheriting parent permissions). We basically want to have various panels in our application that would allow users to view and/or edit content based on the 'inherit, render, enable' permissions. Again, I took the tabs example and created a 'SecurePanel' which appears fine if the user is authorized. It simply contains a SecureTextField which does not appear. I'm assuming that this component would inherit the permissions from its parent so if the user has priviliges to view the parent, they will also see the child. If I change the 'SecureTextField' to a normal 'TextField', it works fine. TestPanel is just another panel on a new SecuredTab that I created. grant principal org.apache.wicket.security.examples.authorization.MyPrincipal super { permission ${ComponentPermission} org.apache.wicket.security.examples.tabs.panels.Heineken, render, enable; permission ${ComponentPermission} org.apache.wicket.security.examples.tabs.panels.Grolsch, render, enable; //issue with SecureTextField not showing up permission ${ComponentPermission} org.apache.wicket.security.examples.tabs.panels.TestPanel, inherit, render, enable; }; TestPanel.java ... /** * Construct. * * @param id */ public TestPanel(String id) { super(id); add(new Label(name, getName())); add(new MultiLineLabel(description, getDescription()).setEscapeModelStrings(false)); add(new ExternalLink(link, getUrl())); //Does not show up! add(new org.apache.wicket.security.components.markup.html.form.SecureTextField(secureTextField)); } ... } thank you, Chris -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://wicketstuff.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
JiraStuff Commented: (WSWASP-5) ContainerSecurityCheck does not work with inherit action
[ http://wicketstuff.org/jira/browse/WSWASP-5?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_10430 ] Maurice Marrink commented on WSWASP-5: -- ComponentPermission in swarm does not take containers other then the Page in to consideration for inheritance, so we might need to fix this problem in 2 places. ContainerSecurityCheck does not work with inherit action Key: WSWASP-5 URL: http://wicketstuff.org/jira/browse/WSWASP-5 Project: WicketStuff WASP Issue Type: Bug Components: Secure Components Affects Versions: 1.3.0 Reporter: Maurice Marrink Assigned To: Maurice Marrink Fix For: 1.3.1 I deployed the examples and they worked fine...however, after some investigation, I wanted to see if I could create a SecurePanel that would contain a SecureTextField and basically do some simple modifications to the example apps to get a better ie a how security implemented in WASP works. The panel shows up fine when a user is authorized to view the page. When the panel contains a normal text field, the user can see it. When it contains a 'SecureTextField', it doesn't appear. I would assume that the child component (SecureTextField) would also appear (inheriting parent permissions). We basically want to have various panels in our application that would allow users to view and/or edit content based on the 'inherit, render, enable' permissions. Again, I took the tabs example and created a 'SecurePanel' which appears fine if the user is authorized. It simply contains a SecureTextField which does not appear. I'm assuming that this component would inherit the permissions from its parent so if the user has priviliges to view the parent, they will also see the child. If I change the 'SecureTextField' to a normal 'TextField', it works fine. TestPanel is just another panel on a new SecuredTab that I created. grant principal org.apache.wicket.security.examples.authorization.MyPrincipal super { permission ${ComponentPermission} org.apache.wicket.security.examples.tabs.panels.Heineken, render, enable; permission ${ComponentPermission} org.apache.wicket.security.examples.tabs.panels.Grolsch, render, enable; //issue with SecureTextField not showing up permission ${ComponentPermission} org.apache.wicket.security.examples.tabs.panels.TestPanel, inherit, render, enable; }; TestPanel.java ... /** * Construct. * * @param id */ public TestPanel(String id) { super(id); add(new Label(name, getName())); add(new MultiLineLabel(description, getDescription()).setEscapeModelStrings(false)); add(new ExternalLink(link, getUrl())); //Does not show up! add(new org.apache.wicket.security.components.markup.html.form.SecureTextField(secureTextField)); } ... } thank you, Chris -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://wicketstuff.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
svn commit: r640436 - in /wicket/trunk/jdk-1.4/wicket/src: main/java/org/apache/wicket/protocol/http/ test/java/org/apache/wicket/stateless/
Author: marrink Date: Mon Mar 24 08:04:57 2008 New Revision: 640436 URL: http://svn.apache.org/viewvc?rev=640436view=rev Log: RESOLVED - issue WICKET-1410: WicketTester and temporary sessions https://issues.apache.org/jira/browse/WICKET-1410 Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/stateless/TemporarySessionTest.java (with props) Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpSession.java wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java?rev=640436r1=640435r2=640436view=diff == --- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java (original) +++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java Mon Mar 24 08:04:57 2008 @@ -183,7 +183,8 @@ private boolean useMultiPartContentType; /** -* Create the request using the supplied session object. +* Create the request using the supplied session object. Note that in order for temporary +* sessions to work, the supplied session must be an instance of [EMAIL PROTECTED] MockHttpSession} * * @param application *The application that this request is for @@ -193,7 +194,7 @@ *The current servlet context */ public MockHttpServletRequest(final Application application, final HttpSession session, - final ServletContext context) + final ServletContext context) { this.application = application; this.session = session; @@ -233,14 +234,14 @@ if (file.exists() == false) { throw new IllegalArgumentException( - File does not exists. You must provide an existing file: + - file.getAbsolutePath()); + File does not exists. You must provide an existing file: + + file.getAbsolutePath()); } if (file.isFile() == false) { throw new IllegalArgumentException( - You can only add a File, which is not a directory. Only files can be uploaded.); + You can only add a File, which is not a directory. Only files can be uploaded.); } if (uploadedFiles == null) @@ -410,7 +411,7 @@ catch (ParseException e) { throw new IllegalArgumentException(Can't convert header to date + name + : + - value); + value); } } @@ -779,6 +780,8 @@ */ public String getRequestedSessionId() { + if (session instanceof MockHttpSession ((MockHttpSession)session).isTemporary()) + return null; return session.getId(); } @@ -870,6 +873,8 @@ */ public HttpSession getSession() { + if (session instanceof MockHttpSession ((MockHttpSession)session).isTemporary()) + return null; return session; } @@ -882,7 +887,9 @@ */ public HttpSession getSession(boolean b) { - return session; + if (b session instanceof MockHttpSession) + ((MockHttpSession)session).setTemporary(false); + return getSession(); } /** @@ -1153,7 +1160,7 @@ { parameters.putAll(params); parameters.put(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME, page.getClass() - .getName()); + .getName()); } /** @@ -1170,7 +1177,7 @@ { final Class clazz = ((BookmarkablePageLink)component).getPageClass(); parameters.put(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME, pageMapName + - ':' + clazz.getName()); + ':' + clazz.getName()); } else { @@ -1199,18 +1206,18 @@ else
[jira] Closed: (WICKET-1410) WicketTester and temporary sessions
[ https://issues.apache.org/jira/browse/WICKET-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink closed WICKET-1410. --- As i could fix my own request, i think this issue is closed. WicketTester and temporary sessions --- Key: WICKET-1410 URL: https://issues.apache.org/jira/browse/WICKET-1410 Project: Wicket Issue Type: Improvement Components: wicket Affects Versions: 1.3.2 Reporter: Maurice Marrink Assignee: Maurice Marrink Priority: Minor Fix For: 1.3.3 Attachments: patch.txt Would be nice if WicketTester supported temporary sessions. in effect be able to test the behavior of Session.isTemporary(). see http://markmail.org/message/yxwvfymq767om4xd -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-1438) detach behavior
detach behavior --- Key: WICKET-1438 URL: https://issues.apache.org/jira/browse/WICKET-1438 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.1 Reporter: Maurice Marrink This was originally posted as a ConcurrentModificationException during detach on the wicket user list (http://markmail.org/message/xnrot5hm4wvow7dq) but later investigations show that there is something else not right. Let me begin by restating the original problem: A couple of days ago Warren came to me with a problem. If he attached a behavior to a component which potentially throws a RestartResponseAtInterceptPageException a ConcurrentModificationException would bubble all the way into tomcat code. Now you probably are going to say: Then don't do that ;) but the fact that an exception escapes wicket is imo reason to investigate. So i did some digging. The situation is as follows: In the renderHead method of an IHeaderContributor a check is performed for an authenticated user, if none is found a RRAIPE is thrown. One of the places that executes renderHead is the onDetach of WebPage. Now suppose we have a Page A which has a component decorated with this header contributor, the page also contains a Button to log off users. The onsubmit for this button is as simple as log user off and setResponsePage(class). This page is usually only accessible if an authenticated user is available so everything works fine if that is the case. But then the user decides to log off, the onsubmit is triggered and exits normally. the request continues and reaches the point where the RequestCycle is detaching all RequestTargets (at that point there are 2 targets, 1 for the current page and 1 set during the onsubmit). During the detach the renderHead method is executed along with the check for an authenticated user. Since there isn't one anymore a RRAIPE is thrown, adding a 3rd target to the stack of RequestTargets. The RRAIPE bubbles up to RequestCycle.detach() and is caught and logged there. Then wicket attempts to detach the next RequestTarget but since an iterator is used to loop through all targets, the iterator detects the stack has been changed and throws a ConcurrentModificationException. Ultimately resulting in a tomcat error page. I tried changing the iterator loop to a regular for(int i=0;i .) loop and this seems to fix the problem, even if later on more requesttargets are added wicket happily executes them and comes up with the desire page. There is one disadvantage i see with this solution: the requesttarget throwing the RRAIPE is not fully detached. Perhaps the RRAIPE can be swallowed after it has added a RequestTarget and only in the case of a detach phase. That way the rest of the page could be normally detached. Here is where it gets interesting: Johan noticed that WebPage.detach should not call renderHead during detach. In fact the only reason it does so is during development when it does not detect a header element. It then checks if there indeed should not be a header by visiting the behaviors and comparing the output to what it currently has. However as the code comments point out it then does nothing with that information because the code that should handle it does not work yet. So the question became why does the page does not have a header element. At first i thought this is because in this case a setResponsePage is done which would suppress any rendering of the current page. However this is not the case as renderhead is also called during detach in a normal page render. It does not matter if the markupfile contains a header element or not. As it turns out the presence of a header element is checked by getting a wicket component with id _header_ This always returns null as there is no such child component. There is however a child component with an id like _header_0 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-1438) detach behavior
[ https://issues.apache.org/jira/browse/WICKET-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink updated WICKET-1438: Attachment: securebutton_app.rar This is a small application showing the ConcurrentModificationException, courtesy of Warren. It is not a quickstart but an eclipse project. Dependencies are swarm 1.30 and wicket 1.3.1 or later. detach behavior --- Key: WICKET-1438 URL: https://issues.apache.org/jira/browse/WICKET-1438 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.1 Reporter: Maurice Marrink Attachments: securebutton_app.rar This was originally posted as a ConcurrentModificationException during detach on the wicket user list (http://markmail.org/message/xnrot5hm4wvow7dq) but later investigations show that there is something else not right. Let me begin by restating the original problem: A couple of days ago Warren came to me with a problem. If he attached a behavior to a component which potentially throws a RestartResponseAtInterceptPageException a ConcurrentModificationException would bubble all the way into tomcat code. Now you probably are going to say: Then don't do that ;) but the fact that an exception escapes wicket is imo reason to investigate. So i did some digging. The situation is as follows: In the renderHead method of an IHeaderContributor a check is performed for an authenticated user, if none is found a RRAIPE is thrown. One of the places that executes renderHead is the onDetach of WebPage. Now suppose we have a Page A which has a component decorated with this header contributor, the page also contains a Button to log off users. The onsubmit for this button is as simple as log user off and setResponsePage(class). This page is usually only accessible if an authenticated user is available so everything works fine if that is the case. But then the user decides to log off, the onsubmit is triggered and exits normally. the request continues and reaches the point where the RequestCycle is detaching all RequestTargets (at that point there are 2 targets, 1 for the current page and 1 set during the onsubmit). During the detach the renderHead method is executed along with the check for an authenticated user. Since there isn't one anymore a RRAIPE is thrown, adding a 3rd target to the stack of RequestTargets. The RRAIPE bubbles up to RequestCycle.detach() and is caught and logged there. Then wicket attempts to detach the next RequestTarget but since an iterator is used to loop through all targets, the iterator detects the stack has been changed and throws a ConcurrentModificationException. Ultimately resulting in a tomcat error page. I tried changing the iterator loop to a regular for(int i=0;i .) loop and this seems to fix the problem, even if later on more requesttargets are added wicket happily executes them and comes up with the desire page. There is one disadvantage i see with this solution: the requesttarget throwing the RRAIPE is not fully detached. Perhaps the RRAIPE can be swallowed after it has added a RequestTarget and only in the case of a detach phase. That way the rest of the page could be normally detached. Here is where it gets interesting: Johan noticed that WebPage.detach should not call renderHead during detach. In fact the only reason it does so is during development when it does not detect a header element. It then checks if there indeed should not be a header by visiting the behaviors and comparing the output to what it currently has. However as the code comments point out it then does nothing with that information because the code that should handle it does not work yet. So the question became why does the page does not have a header element. At first i thought this is because in this case a setResponsePage is done which would suppress any rendering of the current page. However this is not the case as renderhead is also called during detach in a normal page render. It does not matter if the markupfile contains a header element or not. As it turns out the presence of a header element is checked by getting a wicket component with id _header_ This always returns null as there is no such child component. There is however a child component with an id like _header_0 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-1410) WicketTester and temporary sessions
WicketTester and temporary sessions --- Key: WICKET-1410 URL: https://issues.apache.org/jira/browse/WICKET-1410 Project: Wicket Issue Type: Improvement Components: wicket Affects Versions: 1.3.2 Reporter: Maurice Marrink Priority: Minor Would be nice if WicketTester supported temporary sessions. in effect be able to test the behavior of Session.isTemporary(). see http://markmail.org/message/yxwvfymq767om4xd -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-1410) WicketTester and temporary sessions
[ https://issues.apache.org/jira/browse/WICKET-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink updated WICKET-1410: Attachment: patch.txt Patch to allow for temporary sessions WicketTester and temporary sessions --- Key: WICKET-1410 URL: https://issues.apache.org/jira/browse/WICKET-1410 Project: Wicket Issue Type: Improvement Components: wicket Affects Versions: 1.3.2 Reporter: Maurice Marrink Priority: Minor Attachments: patch.txt Would be nice if WicketTester supported temporary sessions. in effect be able to test the behavior of Session.isTemporary(). see http://markmail.org/message/yxwvfymq767om4xd -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
JiraStuff Resolved: (WSSWARM-6) enhanced permission denied logging
[ http://wicketstuff.org/jira/browse/WSSWARM-6?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink resolved WSSWARM-6. --- Resolution: Fixed Integrated in wasp is now logging functionality to log denied actions from WaspAuthorizationStrategy#isActionAuthorized. these log messages are stored in the requestcycle meta data and can be printed at any time during the request (until cleared). The default is to log a debug message trough the logging implementation but this is easily changed by overwriting the logMessage method. By default logging is disabled until debug logging is enabled through the logging implementation for example log4j.category.org.apache.wicket.security.strategies.WaspAuthorizationStrategy=DEBUG enhanced permission denied logging -- Key: WSSWARM-6 URL: http://wicketstuff.org/jira/browse/WSSWARM-6 Project: WicketStuff SWARM Issue Type: Improvement Affects Versions: 1.3.1 Reporter: Maurice Marrink Assigned To: Maurice Marrink Priority: Minor Fix For: 1.3.1 Summary: It would be nice to have custom error messages capable of displaying in detail what was denied. Full request: http://markmail.org/message/bik6p4kujslpcqxg Possible solution: Session.error and wicket propertyfiles TODO: check how much can become part of the wasp api -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://wicketstuff.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
JiraStuff Closed: (WSWASP-3) wicket session is not invalidated after a logoff
[ http://wicketstuff.org/jira/browse/WSWASP-3?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maurice Marrink closed WSWASP-3. wicket session is not invalidated after a logoff Key: WSWASP-3 URL: http://wicketstuff.org/jira/browse/WSWASP-3 Project: WicketStuff WASP Issue Type: Bug Affects Versions: 1.3.0 Reporter: Maurice Marrink Assigned To: Maurice Marrink Fix For: 1.3.0 The session of the user is not invalidated after he logs off -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://wicketstuff.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (WICKET-702) MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException
[ https://issues.apache.org/jira/browse/WICKET-702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540065 ] Maurice Marrink commented on WICKET-702: En bedankt Johan.. 22 failing junit tests vanwege een nullpointer op regel 534 in MockHttpServletRequest: RequestCycle.get() leverd null op, want die is al gedetached. Ik ben nog aan het uitzoeken hoe ik dit kan omzeilen in mn junit tests. Maurice MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException Key: WICKET-702 URL: https://issues.apache.org/jira/browse/WICKET-702 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.0-beta1 Reporter: Mark Sandori Fix For: 1.3.0-rc1 Attachments: 20070703-WICKET-702.txt, LoginPage.html, LoginPage.java, ProtectedPage.html, ProtectedPage.java, RestartWithMountedPageTest.java The MockWebApplication doesn't decode the redirect request properly when redirecting to a mounted page due to a RestartResponseAtInterceptPageException. This is the test: @Test public void testPageRender() { WicketTest tester = new WicketTester(new MyApplication()); //must be logged in to get to the Profile page tester.startPage(Profile.class); //should redirect to the Login page tester.assertRenderedPage(Login.class); } The application mounts pages via: mount(/main, PackageName.forPackage(Profile.class.getPackage())); Running the test results in this exception: org.apache.wicket.WicketRuntimeException: Already redirecting to 'main/Login'. Cannot redirect more than once at org.apache.wicket.protocol.http.BufferedWebResponse.redirect(BufferedWebResponse.java:100) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:219) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:981) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1048) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1127) at org.apache.wicket.RequestCycle.request(RequestCycle.java:489) at org.apache.wicket.protocol.http.MockWebApplication.postProcessRequestCycle(MockWebApplication.java:426) at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:372) at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:237) What is happening is that the redirect URL main/Login is not getting resolved to a bookmarkable page and the RequestParameters is therefore not setup correctly. Then in WebRequestCycleProcessor.resolve(final RequestCycle requestCycle, final RequestParameters requestParameters) the bookmarkablePageClass of the requestParameters is null and the method resolves to the Home page instead of the page that is intended to redirect to. This causes an attempt to redirect again thereby causing the exception. If the mount() is removed then the unit test passes. -- 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-702) MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException
[ https://issues.apache.org/jira/browse/WICKET-702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540065 ] mrmean edited comment on WICKET-702 at 11/4/07 5:56 AM: - Thanks Johan I now have 22 failing junit tests. caused by a nullpointer on line 534 of MockHttpServletRequest: RequestCycle.get() returns null, because it is already detached. The difference in my junit test and the intercept tests seems to lie in the fact that somehow i get a BufferedWebResponse where the wicket junit test gets a regular WebResponse. The BWR does not call HttpServletResponse.sendRedirect(url) where the regular WR does. this causes this call to be executed later after the RC detach. Maurice was (Author: mrmean): En bedankt Johan.. 22 failing junit tests vanwege een nullpointer op regel 534 in MockHttpServletRequest: RequestCycle.get() leverd null op, want die is al gedetached. Ik ben nog aan het uitzoeken hoe ik dit kan omzeilen in mn junit tests. Maurice MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException Key: WICKET-702 URL: https://issues.apache.org/jira/browse/WICKET-702 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.0-beta1 Reporter: Mark Sandori Fix For: 1.3.0-rc1 Attachments: 20070703-WICKET-702.txt, LoginPage.html, LoginPage.java, ProtectedPage.html, ProtectedPage.java, RestartWithMountedPageTest.java The MockWebApplication doesn't decode the redirect request properly when redirecting to a mounted page due to a RestartResponseAtInterceptPageException. This is the test: @Test public void testPageRender() { WicketTest tester = new WicketTester(new MyApplication()); //must be logged in to get to the Profile page tester.startPage(Profile.class); //should redirect to the Login page tester.assertRenderedPage(Login.class); } The application mounts pages via: mount(/main, PackageName.forPackage(Profile.class.getPackage())); Running the test results in this exception: org.apache.wicket.WicketRuntimeException: Already redirecting to 'main/Login'. Cannot redirect more than once at org.apache.wicket.protocol.http.BufferedWebResponse.redirect(BufferedWebResponse.java:100) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:219) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:981) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1048) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1127) at org.apache.wicket.RequestCycle.request(RequestCycle.java:489) at org.apache.wicket.protocol.http.MockWebApplication.postProcessRequestCycle(MockWebApplication.java:426) at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:372) at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:237) What is happening is that the redirect URL main/Login is not getting resolved to a bookmarkable page and the RequestParameters is therefore not setup correctly. Then in WebRequestCycleProcessor.resolve(final RequestCycle requestCycle, final RequestParameters requestParameters) the bookmarkablePageClass of the requestParameters is null and the method resolves to the Home page instead of the page that is intended to redirect to. This causes an attempt to redirect again thereby causing the exception. If the mount() is removed then the unit test passes. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-702) MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException
[ https://issues.apache.org/jira/browse/WICKET-702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540072 ] Maurice Marrink commented on WICKET-702: There was indeed a problem with the MHSR in combination with the BWR but johan fixed it. MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException Key: WICKET-702 URL: https://issues.apache.org/jira/browse/WICKET-702 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.0-beta1 Reporter: Mark Sandori Fix For: 1.3.0-rc1 Attachments: 20070703-WICKET-702.txt, LoginPage.html, LoginPage.java, ProtectedPage.html, ProtectedPage.java, RestartWithMountedPageTest.java The MockWebApplication doesn't decode the redirect request properly when redirecting to a mounted page due to a RestartResponseAtInterceptPageException. This is the test: @Test public void testPageRender() { WicketTest tester = new WicketTester(new MyApplication()); //must be logged in to get to the Profile page tester.startPage(Profile.class); //should redirect to the Login page tester.assertRenderedPage(Login.class); } The application mounts pages via: mount(/main, PackageName.forPackage(Profile.class.getPackage())); Running the test results in this exception: org.apache.wicket.WicketRuntimeException: Already redirecting to 'main/Login'. Cannot redirect more than once at org.apache.wicket.protocol.http.BufferedWebResponse.redirect(BufferedWebResponse.java:100) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:219) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:981) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1048) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1127) at org.apache.wicket.RequestCycle.request(RequestCycle.java:489) at org.apache.wicket.protocol.http.MockWebApplication.postProcessRequestCycle(MockWebApplication.java:426) at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:372) at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:237) What is happening is that the redirect URL main/Login is not getting resolved to a bookmarkable page and the RequestParameters is therefore not setup correctly. Then in WebRequestCycleProcessor.resolve(final RequestCycle requestCycle, final RequestParameters requestParameters) the bookmarkablePageClass of the requestParameters is null and the method resolves to the Home page instead of the page that is intended to redirect to. This causes an attempt to redirect again thereby causing the exception. If the mount() is removed then the unit test passes. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-702) MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException
[ https://issues.apache.org/jira/browse/WICKET-702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522117 ] Maurice Marrink commented on WICKET-702: As submitted to the user list the current resolution breaks the behavior of continueToOriginalDestination when not using mounted urls. Uncomment the code in org.apache.wicket.markup.html.form.login.InterceptTest to see it fail. MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException Key: WICKET-702 URL: https://issues.apache.org/jira/browse/WICKET-702 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.0-beta1 Reporter: Mark Sandori Assignee: Jean-Baptiste Quenot Fix For: 1.3.0-beta4 Attachments: 20070703-WICKET-702.txt, LoginPage.html, LoginPage.java, ProtectedPage.html, ProtectedPage.java, RestartWithMountedPageTest.java The MockWebApplication doesn't decode the redirect request properly when redirecting to a mounted page due to a RestartResponseAtInterceptPageException. This is the test: @Test public void testPageRender() { WicketTest tester = new WicketTester(new MyApplication()); //must be logged in to get to the Profile page tester.startPage(Profile.class); //should redirect to the Login page tester.assertRenderedPage(Login.class); } The application mounts pages via: mount(/main, PackageName.forPackage(Profile.class.getPackage())); Running the test results in this exception: org.apache.wicket.WicketRuntimeException: Already redirecting to 'main/Login'. Cannot redirect more than once at org.apache.wicket.protocol.http.BufferedWebResponse.redirect(BufferedWebResponse.java:100) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:219) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:981) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1048) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1127) at org.apache.wicket.RequestCycle.request(RequestCycle.java:489) at org.apache.wicket.protocol.http.MockWebApplication.postProcessRequestCycle(MockWebApplication.java:426) at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:372) at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:237) What is happening is that the redirect URL main/Login is not getting resolved to a bookmarkable page and the RequestParameters is therefore not setup correctly. Then in WebRequestCycleProcessor.resolve(final RequestCycle requestCycle, final RequestParameters requestParameters) the bookmarkablePageClass of the requestParameters is null and the method resolves to the Home page instead of the page that is intended to redirect to. This causes an attempt to redirect again thereby causing the exception. If the mount() is removed then the unit test passes. -- 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-702) MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException
[ https://issues.apache.org/jira/browse/WICKET-702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522117 ] mrmean edited comment on WICKET-702 at 8/23/07 5:09 AM: - As submitted to the user list the current solution breaks the behavior of continueToOriginalDestination when not using mounted urls. Uncomment the code in org.apache.wicket.markup.html.form.login.InterceptTest to see it fail. was (Author: mrmean): As submitted to the user list the current resolution breaks the behavior of continueToOriginalDestination when not using mounted urls. Uncomment the code in org.apache.wicket.markup.html.form.login.InterceptTest to see it fail. MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException Key: WICKET-702 URL: https://issues.apache.org/jira/browse/WICKET-702 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.0-beta1 Reporter: Mark Sandori Assignee: Jean-Baptiste Quenot Fix For: 1.3.0-beta4 Attachments: 20070703-WICKET-702.txt, LoginPage.html, LoginPage.java, ProtectedPage.html, ProtectedPage.java, RestartWithMountedPageTest.java The MockWebApplication doesn't decode the redirect request properly when redirecting to a mounted page due to a RestartResponseAtInterceptPageException. This is the test: @Test public void testPageRender() { WicketTest tester = new WicketTester(new MyApplication()); //must be logged in to get to the Profile page tester.startPage(Profile.class); //should redirect to the Login page tester.assertRenderedPage(Login.class); } The application mounts pages via: mount(/main, PackageName.forPackage(Profile.class.getPackage())); Running the test results in this exception: org.apache.wicket.WicketRuntimeException: Already redirecting to 'main/Login'. Cannot redirect more than once at org.apache.wicket.protocol.http.BufferedWebResponse.redirect(BufferedWebResponse.java:100) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:219) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:981) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1048) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1127) at org.apache.wicket.RequestCycle.request(RequestCycle.java:489) at org.apache.wicket.protocol.http.MockWebApplication.postProcessRequestCycle(MockWebApplication.java:426) at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:372) at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:237) What is happening is that the redirect URL main/Login is not getting resolved to a bookmarkable page and the RequestParameters is therefore not setup correctly. Then in WebRequestCycleProcessor.resolve(final RequestCycle requestCycle, final RequestParameters requestParameters) the bookmarkablePageClass of the requestParameters is null and the method resolves to the Home page instead of the page that is intended to redirect to. This causes an attempt to redirect again thereby causing the exception. If the mount() is removed then the unit test passes. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.