You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Raible, Matt" <Ma...@cable.comcast.com> on 2003/01/20 19:48:59 UTC

Using html:img tag in a java class

I am using a custom LabelTag to automatically render validation messages
next to my form elements, as well as to look up ApplicationResources.  When
an error occurs, I want to output a warning icon next to the label.  I was
hoping I could use the ImageTag to do this.  I have successfully called and
populated it, but how do I get the output into a StringBuffer?

		// I've already built the <label> tag at this point

            ImageTag img = new ImageTag();
            img.setPageKey("icon.warning.img");
            img.setAlt(message);
            img.setStyleClass("icon");

		label.append(??);


I tried label.append(img.toString()), but I got:

org.apache.struts.taglib.html.ImageTag@9083c1    

Thanks,

Matt



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>