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

Adding behavior in component instantiation listener causes Page.onInitialize() being called even if constructor throws an exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.13.0, 6.14.0
    • Fix Version/s: 7.0.0-M1, 6.15.0
    • Component/s: wicket
    • Labels:
      None

      Description

      Page.onInitialize() will be called even if constructor throws an exception
      in case below code is added in wicket WebApplication.init():
      getComponentInstantiationListeners().add(new IComponentInstantiationListener() {
      @Override
      public void onInstantiation(Component component) {
      component.add(new Behavior() {

      });
      }

      });

      It seems that the instantiation listener adds the behavior to the page at very start of the page constructor, and then the page is marked as dirty to cause onInitialize() being called afterwards.

        Attachments

        1. WICKET-5546.zip
          22 kB
          Sven Meier
        2. WICKET-5546.patch
          1 kB
          Sven Meier

          Activity

            People

            • Assignee:
              svenmeier Sven Meier
              Reporter:
              robinshine Robin Shine
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: