Stateless forms make page statefull?
------------------------------------

                 Key: WICKET-4001
                 URL: https://issues.apache.org/jira/browse/WICKET-4001
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5-RC7
            Reporter: Francis De Brabandere


See provided quickstart

I have no idea why but Stateless forms seem to make pages stateful. Tested 
using @StatelessComponent and the StatelessChecker.

Example mainly from https://cwiki.apache.org/WICKET/stateless-pages.html

                tester.startPage(HomePage.class);
                tester.assertRenderedPage(HomePage.class);
                FormTester form = tester.newFormTester("form"); 
                form.submit();

the form.submit() fails with only this info:

java.lang.IllegalArgumentException: '[Page class = web.web.HomePage, id = 1, 
render count = 1]' claims to be stateless but isn't. Possible reasons: no 
stateless hint, statefull behaviors
        at 
org.apache.wicket.devutils.stateless.StatelessChecker.onBeforeRender(StatelessChecker.java:92)
        at 
org.apache.wicket.application.ComponentOnBeforeRenderListenerCollection$1.notify(ComponentOnBeforeRenderListenerCollection.java:38)
        at 
org.apache.wicket.application.ComponentOnBeforeRenderListenerCollection$1.notify(ComponentOnBeforeRenderListenerCollection.java:36)
        at 
org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:79)
        at 
org.apache.wicket.application.ComponentOnBeforeRenderListenerCollection.onBeforeRender(ComponentOnBeforeRenderListenerCollection.java:34)
        at org.apache.wicket.Component.internalBeforeRender(Component.java:976)
        at org.apache.wicket.Component.beforeRender(Component.java:1012)
        at 
org.apache.wicket.Component.internalPrepareForRender(Component.java:2178)
        at org.apache.wicket.Page.internalPrepareForRender(Page.java:280)
        at org.apache.wicket.Component.render(Component.java:2265)
        at org.apache.wicket.Page.renderPage(Page.java:1035)
        at 
org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
        at 
org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:182)
        at 
org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:147)
        at 
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:719)
        at 
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63)
        at 
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:96)
        at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
        at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
        at 
org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:596)
        at 
org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:516)
        at 
org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:488)
        at 
org.apache.wicket.util.tester.BaseWicketTester.submitForm(BaseWicketTester.java:1828)
        at org.apache.wicket.util.tester.FormTester.submit(FormTester.java:725)
        at 
web.web.TestHomePage.homepageRendersSuccessfully(TestHomePage.java:27)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
        at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to