Tapestry
  1. Tapestry
  2. TAPESTRY-1253

Meta injection throws exception unless property accessor is defined

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.2
    • Fix Version/s: 4.1.2
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      .page:

      <meta key="testMeta" value="123"/>
      <inject property="testInject" object="testMeta" type="meta"/>
      <component id="test" type="Insert">
      <binding name="value" value="testInject"/>
      </component>

      results in an exception:

      NullPointerException: Parameter clazz must not be null.

      Stack Trace:
      org.apache.hivemind.util.Defense.notNull(Defense.java:41)
      org.apache.tapestry.enhance.EnhancementOperationImpl.getClassReference(EnhancementOperationImpl.java:385)

      org.apache.tapestry.enhance.InjectMetaWorker.addObject(InjectMetaWorker.java:136)
      org.apache.tapestry.enhance.InjectMetaWorker.injectMetaValue(InjectMetaWorker.java:96)
      org.apache.tapestry.enhance.InjectMetaWorker.performEnhancement(InjectMetaWorker.java:62)
      ..etc...

      To avoid this exception an abstract getter method must be defined, like this:

      public abstract String getTestInject();

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Ilya Zverev
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development