Class ImageTag

  • All Implemented Interfaces:
    javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag

    public class ImageTag
    extends javax.servlet.jsp.tagext.SimpleTagSupport
    Implements the wm:image tag. Creates an Image object from its url.
    Example of usage:
     < wm:image var="photo" url="http://www.gx.nl/images/picture.jpg" alternativeText="a picture" />
     ${image.htmlTag}
     
    The example above creates an Image object for www.gx.nl/images/picture.jpg storing "a picture" as value to be used for the 'alt="..."' attribute of the HTML img tag.
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageTag()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doTag()  
      protected String getAlign()
      Return the alignment value to use in the 'align=�...�' attribute of the HTML img tag.
      protected String getAlternativeText()
      Return the alternative text to use in the 'alt=�...�' attribute of the HTML img tag.
      protected String getUrl()
      Return the url where the image can be found.
      protected String getVar()
      Return the JSP variable to store the result in.
      void setAlign​(String align)
      Sets the alignment value to use in the 'align=�...�' attribute of the HTML img tag.
      void setAlternativeText​(String alternativeText)
      Specificies the alternative text to use in the 'alt=�...�' attribute of the HTML img tag.
      void setUrl​(String url)
      Specifies the url where the image can be found.
      void setVar​(String var)
      Specifies the JSP variable to store the result in.
      • Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport

        findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
    • Constructor Detail

      • ImageTag

        public ImageTag()
    • Method Detail

      • setUrl

        public void setUrl​(String url)
        Specifies the url where the image can be found. The value of this attribute is used in the 'src=�...�' attribute of the HTML img tag.
        Parameters:
        url - the url where the image can be found
      • getUrl

        protected String getUrl()
        Return the url where the image can be found. The value of this attribute is used in the 'src=�...�' attribute of the HTML img tag.
        Returns:
        the url where the image can be found
      • setVar

        public void setVar​(String var)
        Specifies the JSP variable to store the result in.
        Parameters:
        var - the name of the JSP variable to store the result in
      • getVar

        protected String getVar()
        Return the JSP variable to store the result in.
        Returns:
        name of the JSP variable to store the result in
      • setAlign

        public void setAlign​(String align)
        Sets the alignment value to use in the 'align=�...�' attribute of the HTML img tag.
        Parameters:
        align - alignment of the image.
      • getAlign

        protected String getAlign()
        Return the alignment value to use in the 'align=�...�' attribute of the HTML img tag.
        Returns:
        align alignment of the image.
      • setAlternativeText

        public void setAlternativeText​(String alternativeText)
        Specificies the alternative text to use in the 'alt=�...�' attribute of the HTML img tag.
        Parameters:
        alternativeText - text used for the alt attribute.
      • getAlternativeText

        protected String getAlternativeText()
        Return the alternative text to use in the 'alt=�...�' attribute of the HTML img tag.
        Returns:
        alternativeText text used for the alt attribute.
      • doTag

        public void doTag()
                   throws javax.servlet.jsp.JspException
        Specified by:
        doTag in interface javax.servlet.jsp.tagext.SimpleTag
        Overrides:
        doTag in class javax.servlet.jsp.tagext.SimpleTagSupport
        Throws:
        javax.servlet.jsp.JspException