nl.gx.webmanager.taglib
Class ImageTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.SimpleTagSupport
      extended by nl.gx.webmanager.taglib.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
ImageTag()
           
 
Method Summary
 void doTag()
           
protected  java.lang.String getAlign()
          Return the alignment value to use in the 'align=�...�' attribute of the HTML img tag.
protected  java.lang.String getAlternativeText()
          Return the alternative text to use in the 'alt=�...�' attribute of the HTML img tag.
protected  java.lang.String getUrl()
          Return the url where the image can be found.
protected  java.lang.String getVar()
          Return the JSP variable to store the result in.
 void setAlign(java.lang.String align)
          Sets the alignment value to use in the 'align=�...�' attribute of the HTML img tag.
 void setAlternativeText(java.lang.String alternativeText)
          Specificies the alternative text to use in the 'alt=�...�' attribute of the HTML img tag.
 void setUrl(java.lang.String url)
          Specifies the url where the image can be found.
 void setVar(java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageTag

public ImageTag()
Method Detail

setUrl

public void setUrl(java.lang.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 java.lang.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(java.lang.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 java.lang.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(java.lang.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 java.lang.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(java.lang.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 java.lang.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


Copyright © 2007-2011 GX Software BV. All Rights Reserved.