commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Anderson" <>
Subject [jelly][PATCH] New tags: extend and super
Date Sun, 27 Oct 2002 03:08:56 GMT
	attached is support for two new tags, <define:extend>
and <define:super>.
The <define:extend> tag allows an inherited dynamic tag to be extended.
The <define:super> tag may be used within a <define:extend> to invoke
the parent tag implementation.


// coretags.jelly
  <define:taglib uri="">

    <define:tag name="create-table">
      CREATE TABLE ${} (
      <embedded-primary-key />
      <embedded-foreign-keys />

// oracletags.jelly
  <j:include uri="coretags.jelly"/>

  <!-- extend the core tag library -->
  <define:taglib uri="" inherit="true">

    <!-- extend the coretag implementation of create-table -->
    <!-- to handle  auto increment columns for oracle      -->
    <define:extend name="create-table">
        <j:when test="${table.autoIncrementColumn != null}">
          <create-sequence />
          <define:super/>  <!-- invoke coretags implementation of
create-table -->
          <create-sequence-trigger column="${table.autoIncrementColumn}"/>

. <define:extend> replaces the parent taglibs implementation
  of the named tag with its own.
  There may be instances where this is not the desired behaviour?

. <define:extend> can only be used to extend <define:tag> tags
  A possible enhancement would be to allow it to extend
  other non-script based tags

. the ExtendTag behaviour could be rolled into TagTag.
  I've created a separate class to make it explicit that a tag
  is being extended.
  At the moment, using a <define:tag> specifying the same name
  as a parent taglibs <define:tag> generally yields behaviour
  which is probably not the expected one.



View raw message