Uploaded image for project: 'Click'
  1. Click
  2. CLK-562

AbstractControl and default constructor

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.0
    • Component/s: documentation
    • Labels:
      None

      Description

      The AbstractControl javadoc says: "Subclasses are expected to at least override getTag() to differentiate the control.". What it also should mention, is that it needs a default constructor if you have created a custom constructor.

      At deploy time, all the controls listed in click.xml will have their onDeploy() method called. But the reflection part will fail if the default cstor does not exist.

      org.apache.click.service.XmlConfigService.deployControls(XmlConfigService.java:1077):
      Class deployClass = ClickUtils.classForName(classname);
      Control control = (Control) deployClass.newInstance(); //<--- fails at deploy time
      control.onDeploy(servletContext);

        Attachments

          Activity

            People

            • Assignee:
              sabob Bob Schellink
              Reporter:
              surfman WarnerJan Veldhuis
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: