TLDs don't provide for specifying a default value for an attribute. You'll probably need to define a pair of sub-classes that default the attribute appropriately, and map those in the TLD.

L.

Pascal Forget wrote:
Hi,

I modified the PropertyTag to add a "formatterClass" parameter.

I would like to be able to define the tag under two names in the tld file and 
set the formatterClass parameter based on the name.  Something like this:

 <tag>
    <name>duration</name>
    <tag-class>com.ubeans.struts2.views.jsp.PropertyTag</tag-class>
[...]
    <attribute>
      <name>formatterClass</name>
      <default-value>com.ubeans.util.TimeElapedFormatter<default-value>
[...]


  </tag>
<tag>

    <name>encoder</name>

    <tag-class>com.ubeans.struts2.views.jsp.PropertyTag</tag-class>

[...]

    <attribute>

      <name>formatterClass</name>

      <default-value>com.ubeans.util.EnigmaEncoder<default-value>

[...]



  </tag>

Can something like this be done?

Thanks,

Pascal


_________________________________________________________________




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to