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

Derived page without own markup leads to MarkupNotFoundException when BasePage has <wicket:head> in its markup

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Implemented
    • Affects Version/s: 6.14.0
    • Fix Version/s: 6.15.0
    • Component/s: wicket
    • Labels:
      None

      Description

      Both Page1 and Page2 extend BasePage (which extends WebPage).

      BasePage.html:

      <html>
      <wicket:head>
      ...
      </wicket:head>
      <body>
      ...
      <wicket:child/>	
      ...
      </body>
      </html>
      

      Page1.html:

      <wicket:extend>
      ...
      </wicket:extend>
      

      Page2 hat no own markup (there is no Page2.html).

      Calling Page1 and then Page2 leads to the following MarkupNotFoundException:

      org.apache.wicket.markup.MarkupNotFoundException
      'Markup not found for Component: [HtmlHeaderContainer [Component id = _header_0]]'
      org.apache.wicket.Component.internalRender(Component.java:2349)
      org.apache.wicket.Component.render(Component.java:2309)
      org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1390)
      org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1555)
      org.apache.wicket.Page.onRender(Page.java:887)
      org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:142)
      org.apache.wicket.Component.internalRender(Component.java:2381)
      org.apache.wicket.Component.render(Component.java:2309)
      org.apache.wicket.Page.renderPage(Page.java:1024)
      org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:121)
      org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:274)
      org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
      org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
      org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
      org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
      org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
      org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
      org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
      org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
      org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      java.lang.Thread.run(Thread.java:662)
      

      (Calling Page2 without having called Page1 does not lead to a MarkupNotFoundException.)

      1. wicket5561.zip
        24 kB
        Dirk Reichelt

        Issue Links

          Activity

          Hide
          mgrigorov Martin Grigorov added a comment -

          Please provide a quickstart app (http://wicket.apache.org/start/quickstart.html).
          Thanks!

          Show
          mgrigorov Martin Grigorov added a comment - Please provide a quickstart app ( http://wicket.apache.org/start/quickstart.html ). Thanks!
          Hide
          dirk.reichelt Dirk Reichelt added a comment -

          Attachment wicket5561.zip contains a quickstart app showing the bug.
          (Click on "Page1" in the HomePage, then go back to the HomePage (Browser back), then click on "Page2" to trigger the MarkupNotFoundException)

          TestHomePage contains the test test1 that fails due to the bug, as Page 1 is called before Page2.
          The Test test2 does not fail, as Page1 ist not called before Page2.

          Show
          dirk.reichelt Dirk Reichelt added a comment - Attachment wicket5561.zip contains a quickstart app showing the bug. (Click on "Page1" in the HomePage, then go back to the HomePage (Browser back), then click on "Page2" to trigger the MarkupNotFoundException) TestHomePage contains the test test1 that fails due to the bug, as Page 1 is called before Page2. The Test test2 does not fail, as Page1 ist not called before Page2.
          Hide
          mgrigorov Martin Grigorov added a comment -

          This seems to be fixed incidentally with WICKET-5531

          Show
          mgrigorov Martin Grigorov added a comment - This seems to be fixed incidentally with WICKET-5531

            People

            • Assignee:
              mgrigorov Martin Grigorov
              Reporter:
              dirk.reichelt Dirk Reichelt
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development