Class ImageTag

All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag
Direct Known Subclasses:
FlagTag, ImageBeanTag, RemoteAddressTag

public class ImageTag extends ElementTag
An JSP Tag to generate an IMG element.
Since:
1.0
Version:
10.2
Author:
Luke
See Also:
  • Constructor Details

    • ImageTag

      public ImageTag()
      Creates a new Image element tag.
  • Method Details

    • renderHTML

      protected void renderHTML() throws Exception
      Renders the image tag tot he JSP output stream.
      Throws:
      Exception - if an error occurs
    • doEndTag

      public int doEndTag() throws JspException
      Generates this image's HTML.
      Specified by:
      doEndTag in interface Tag
      Overrides:
      doEndTag in class TagSupport
      Throws:
      JspException - if an error occurs
    • setX

      public void setX(int width)
      Sets the width of ths image. This does nothing if a negative, zero or non-numeric value is passed.
      Parameters:
      width - the width of the image in pixels
    • setY

      public void setY(int height)
      Sets the height of ths image. This does nothing if a negative, zero or non-numeric value is passed.
      Parameters:
      height - the height of the image in pixels
    • setSrc

      public void setSrc(String url)
      Sets the source of this image.
      Parameters:
      url - the location of the image
    • setCaption

      public void setCaption(String caption)
      Sets the alternate caption for this image.
      Parameters:
      caption - the caption for this mage
    • release

      public void release()
      Specified by:
      release in interface Tag
      Overrides:
      release in class ElementTag
    • doStartTag

      public int doStartTag() throws JspException
      Executed post tag setup. Creates a STYLE element if dimensions specified.
      Specified by:
      doStartTag in interface Tag
      Overrides:
      doStartTag in class ElementTag
      Returns:
      SKIP_BODY always
      Throws:
      JspException - if an error occurs