Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6036

Failure to process markup with nested tags inside a Label

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 7.0.0, 7.1.0
    • 7.2.0, 8.0.0-M1
    • wicket
    • None

    Description

      The fix for WICKET-5730 causes previously accepted markup to be rejected under some circumstances. In our case, we have a Label, which renders some markup (text and an image), and expressed this in the markup for the panel:

      <wicket:panel>
      	<span wicket:id="test"> test <img src="img.png" /></span>
      </wicket:panel>
      

      When you add this Label to the panel, the following Exception is triggered:

      java.lang.IllegalStateException: Tag '<img src="img.png"/>' should be the closing one for '<span wicket:id="test">'
      	at org.apache.wicket.MarkupContainer.dequeueChild(MarkupContainer.java:2163)
      	at org.apache.wicket.MarkupContainer.dequeue(MarkupContainer.java:2120)
      	at org.apache.wicket.MarkupContainer.dequeuePreamble(MarkupContainer.java:2075)
      	at org.apache.wicket.MarkupContainer.dequeue(MarkupContainer.java:1993)
      	at org.apache.wicket.MarkupContainer.addedComponent(MarkupContainer.java:1049)
      	at org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)
      	at org.apache.wicket.util.tester.BaseWicketTester.startComponentInPage(BaseWicketTester.java:1460)
      	at org.apache.wicket.util.tester.BaseWicketTester.startComponentInPage(BaseWicketTester.java:1386)
      	at org.apache.wicket.queueing.ComponentQueueingCompatibilityTest.nestedTags(ComponentQueueingCompatibilityTest.java:28)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      

      This is a regression since 6.x, introduced by commit db5be6ab05545e1bb95f566c3aeb23e05cf93437. I've added a disabled testcase to demonstrate the problem.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mgrigorov Martin Tzvetanov Grigorov
            papegaaij Emond Papegaaij
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment