Uploaded image for project: 'Commons Jelly'
  1. Commons Jelly
  2. JELLY-234

Nested DynamicTag and <invokeBody/> doesn't work correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Component/s: core / taglib.core
    • Labels:
      None

      Description

      Consider a doubly nested <invokeBody/> invocations like the following sequence,
      where tag A and B are DynamicTag:

      <A>
      <X/>
      </A>

      where A is defined as ...

      <B>
      <Y>
      <define:invokeBody/>
      </Y>
      </B>

      where B is defined as ...

      <B>
      <define:invokeBody/>
      </B>

      For this to correctly expands to <Y><X/></Y>,
      We need to find the <X/> as the body when we are executing <define:invokeBody/> inside <Y> tag.
      To do this, body Tags (to be invoked) need to be maintained as a stack.

      The additional reservevd 'org.apache.commons.jelly.body.scope' variable performs this role.
      Whenever a JellyContext has 'org.apache.commons.jelly.body', there's always
      'org.apache.commons.jelly.body.scope' variable on the same context. The 'scope' points back
      to the JellyContext where the previous 'org.apache.commons.jelly.body' (and
      hence 'o.a.c.j.b.scope' as well) is available, thus forming a stack in terms of linked list.

        Attachments

        1. JELLY-234.patch
          3 kB
          Kohsuke Kawaguchi

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kohsuke Kohsuke Kawaguchi
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: