You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian Sayatovic/AMIG <BS...@amig.com> on 2005/11/16 23:35:11 UTC

TagSupport.id vs. Struts' styleId

What is the "id" attribute in TagSupport for.  Some have guessed its for
the HTML ID attribute, but nothign in TagSupport renders it.  IN fact, when
Struts' own taglib needs to set the HTML ID attribute, the "styleId"
attribute of the tag is set instead.  Why not use the inherited "id"
attribute instead?  I can't find any documentation that says what it's used
for, nor why someone else shouldn't leverage it.

Regards,
Brian.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: TagSupport.id vs. Struts' styleId

Posted by Craig McClanahan <cr...@apache.org>.
On 11/16/05, Brian Sayatovic/AMIG <BS...@amig.com> wrote:
>
> What is the "id" attribute in TagSupport for. Some have guessed its for
> the HTML ID attribute, but nothign in TagSupport renders it. IN fact, when
> Struts' own taglib needs to set the HTML ID attribute, the "styleId"
> attribute of the tag is set instead. Why not use the inherited "id"
> attribute instead? I can't find any documentation that says what it's used
> for, nor why someone else shouldn't leverage it.



You're gonna love this one :-). In the very early days of Struts, different
implementations of JSP (and particularly TagSupport) were buggy around how
they dealt with the "id" attribute -- partially because the early specs were
more than a little fuzzy on the required behavior. To guarantee consistent
behavior, we had to use some other attribute instead, and chose to use
"styleId" as a complement to "styleClass".

Now, of course, the implementations are much more consistent -- but
backwards compatibility breakage would occur if we tried to change the
behavior of the tags.

Regards,
> Brian.


Craig