Hi,

Is it possible to create a JSP custom tag and package
the same class under different names in the tld description
and from inside the tag class determine the name that
was used to invoke it. Some kind of implicit parameter
passing.

Example:

<tag>
  <name>A</name>
  <tagclass>X</tagclass>
  <bodycontent>empty</bodycontent>
</tag>
<tag>
  <name>B</name>
  <tagclass>X</tagclass>
  <bodycontent>empty</bodycontent>
</tag>
<tag>
  <name>C</name>
  <tagclass>X</tagclass>
  <bodycontent>empty</bodycontent>
</tag>

public class X extends TagSupport
{
  public int doStartTag()
    throws JspException
  {
    // Get the name of the tag that
    // that was used to invoke the call: A, B or C
    String name = ...;
};

I see from the spec. that the info is available
in the class TagInfo, but I can't see how I can
get hold of an instance (if possible).

Regards
/Magnus

Reply via email to