org.apache.struts.taglib.html

Class ImgTag

Known Direct Subclasses:
NestedImgTag

public class ImgTag
extends BaseHandlerTag

Generate an IMG tag to the specified image URI.

TODO:

Version:
$Rev: 164927 $

Field Summary

protected String
action
The module-relative action (beginning with a slash) which will be used as the source for this image.
protected String
align
The property to specify where to align the image.
protected String
border
The border size around the image.
protected String
contextRelative
Deprecated. Use module property instead; will be removed in a release after 1.2.0.
protected String
height
The image height.
protected String
hspace
The horizontal spacing around the image.
protected String
imageName
The image name for named images.
protected String
ismap
Server-side image map declaration.
protected String
lowsrc
Deprecated. This is not defined in the HTML 4.01 spec and will be removed in a future version of Struts.
protected static MessageResources
messages
The message resources for this package.
protected String
module
The module prefix (beginning with a slash) which will be used to find the action for this link.
protected String
name
The JSP bean name for query parameters.
protected String
page
The module-relative path, starting with a slash character, of the image to be displayed by this rendered tag.
protected String
pageKey
The message resources key under which we should look up the page attribute for this generated tag, if any.
protected String
paramId
In situations where an image is dynamically generated (such as to create a chart graph), this specifies the single-parameter request parameter name to generate.
protected String
paramName
The single-parameter JSP bean name.
protected String
paramProperty
The single-parameter JSP bean property.
protected String
paramScope
The single-parameter JSP bean scope.
protected String
property
The JSP bean property name for query parameters.
protected String
scope
The scope of the bean specified by the name property, if any.
protected String
src
The image source URI.
protected String
srcKey
The message resources key under which we should look up the src attribute for this generated tag, if any.
protected boolean
useLocalEncoding
protected String
usemap
Client-side image map declaration.
protected String
vspace
The vertical spacing around the image.
protected String
width
The image width.

Fields inherited from class org.apache.struts.taglib.html.BaseHandlerTag

accesskey, alt, altKey, bundle, defaultLocale, disabled, doDisabled, doReadonly, errorKey, errorStyle, errorStyleClass, errorStyleId, indexed, locale, log, loopTagStatusClass, loopTagStatusGetIndex, loopTagSupportClass, loopTagSupportGetStatus, messages, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselect, readonly, style, styleClass, styleId, tabindex, title, titleKey, triedJstlInit, triedJstlSuccess

Constructor Summary

ImgTag()

Method Summary

int
doEndTag()
Render the end of the IMG tag.
int
doStartTag()
Render the beginning of the IMG tag.
String
getAction()
String
getAlign()
String
getBorder()
String
getContextRelative()
Deprecated. Use module property instead; will be removed in a release after 1.2.0.
String
getHeight()
String
getHspace()
String
getImageName()
String
getIsmap()
String
getLowsrc()
Deprecated. This is not defined in the HTML 4.01 spec and will be removed in a future version of Struts.
String
getModule()
String
getName()
String
getPage()
String
getPageKey()
String
getParamId()
String
getParamName()
String
getParamProperty()
String
getParamScope()
String
getProperty()
String
getScope()
String
getSrc()
String
getSrcKey()
String
getUsemap()
String
getVspace()
String
getWidth()
boolean
isContextRelativeSet()
Deprecated. Use module property instead; will be removed in a release after 1.2.0.
boolean
isUseLocalEncoding()
void
release()
Release any acquired resources.
void
setAction(String action)
void
setAlign(String align)
void
setBorder(String border)
void
setContextRelative(String contextRelative)
Deprecated. Use module property instead; will be removed in a release after 1.2.0.
void
setHeight(String height)
void
setHspace(String hspace)
void
setImageName(String imageName)
void
setIsmap(String ismap)
void
setLowsrc(String lowsrc)
void
setModule(String module)
void
setName(String name)
void
setPage(String page)
void
setPageKey(String pageKey)
void
setParamId(String paramId)
void
setParamName(String paramName)
void
setParamProperty(String paramProperty)
void
setParamScope(String paramScope)
void
setProperty(String property)
void
setScope(String scope)
void
setSrc(String src)
void
setSrcKey(String srcKey)
void
setUseLocalEncoding(boolean b)
void
setUsemap(String usemap)
void
setVspace(String vspace)
void
setWidth(String width)
protected String
src()
Return the base source URL that will be rendered in the src property for this generated element, or null if there is no such URL.
private boolean
srcDefaultReference(ModuleConfig config)
Convenience method to test whether this is the default module or if contestRelative has been set.
private void
throwImgTagSrcException()
Convenience method to throw a "imgTag.src" exception.
protected String
url(String url)
Return the specified src URL, modified as necessary with optional request parameters.

Methods inherited from class org.apache.struts.taglib.html.BaseHandlerTag

doErrorsExist, getAccesskey, getAlt, getAltKey, getBundle, getDisabled, getElementClose, getErrorKey, getErrorStyle, getErrorStyleClass, getErrorStyleId, getIndexValue, getIndexed, getJstlLoopIndex, getLocale, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getReadonly, getStyle, getStyleClass, getStyleId, getTabindex, getTitle, getTitleKey, isXhtml, lookupProperty, message, prepareAttribute, prepareEventHandlers, prepareFocusEvents, prepareIndex, prepareKeyEvents, prepareMouseEvents, prepareName, prepareOtherAttributes, prepareStyles, prepareTextEvents, release, setAccesskey, setAlt, setAltKey, setBundle, setDisabled, setErrorKey, setErrorStyle, setErrorStyleClass, setErrorStyleId, setIndexed, setLocale, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setReadonly, setStyle, setStyleClass, setStyleId, setTabindex, setTitle, setTitleKey

Field Details

action

protected String action
The module-relative action (beginning with a slash) which will be used as the source for this image.

align

protected String align
The property to specify where to align the image.

border

protected String border
The border size around the image.

contextRelative

protected String contextRelative

Deprecated. Use module property instead; will be removed in a release after 1.2.0.

The property to specify how to root the image. If 'true' or if there is no current module the image is rooted to the application context path If 'false' or absent the image is rooted to the current module's context path.

height

protected String height
The image height.

hspace

protected String hspace
The horizontal spacing around the image.

imageName

protected String imageName
The image name for named images.

ismap

protected String ismap
Server-side image map declaration.

lowsrc

protected String lowsrc

Deprecated. This is not defined in the HTML 4.01 spec and will be removed in a future version of Struts.

The low resolution image source URI.

messages

protected static MessageResources messages
The message resources for this package.

module

protected String module
The module prefix (beginning with a slash) which will be used to find the action for this link.

name

protected String name
The JSP bean name for query parameters.

page

protected String page
The module-relative path, starting with a slash character, of the image to be displayed by this rendered tag.

pageKey

protected String pageKey
The message resources key under which we should look up the page attribute for this generated tag, if any.

paramId

protected String paramId
In situations where an image is dynamically generated (such as to create a chart graph), this specifies the single-parameter request parameter name to generate.

paramName

protected String paramName
The single-parameter JSP bean name.

paramProperty

protected String paramProperty
The single-parameter JSP bean property.

paramScope

protected String paramScope
The single-parameter JSP bean scope.

property

protected String property
The JSP bean property name for query parameters.

scope

protected String scope
The scope of the bean specified by the name property, if any.

src

protected String src
The image source URI.

srcKey

protected String srcKey
The message resources key under which we should look up the src attribute for this generated tag, if any.

useLocalEncoding

protected boolean useLocalEncoding

usemap

protected String usemap
Client-side image map declaration.

vspace

protected String vspace
The vertical spacing around the image.

width

protected String width
The image width.

Constructor Details

ImgTag

public ImgTag()

Method Details

doEndTag

public int doEndTag()
            throws JspException
Render the end of the IMG tag.

doStartTag

public int doStartTag()
            throws JspException
Render the beginning of the IMG tag.

getAction

public String getAction()

getAlign

public String getAlign()

getBorder

public String getBorder()

getContextRelative

public String getContextRelative()

Deprecated. Use module property instead; will be removed in a release after 1.2.0.


getHeight

public String getHeight()

getHspace

public String getHspace()

getImageName

public String getImageName()

getIsmap

public String getIsmap()

getLowsrc

public String getLowsrc()

Deprecated. This is not defined in the HTML 4.01 spec and will be removed in a future version of Struts.


getModule

public String getModule()

getName

public String getName()

getPage

public String getPage()

getPageKey

public String getPageKey()

getParamId

public String getParamId()

getParamName

public String getParamName()

getParamProperty

public String getParamProperty()

getParamScope

public String getParamScope()

getProperty

public String getProperty()

getScope

public String getScope()

getSrc

public String getSrc()

getSrcKey

public String getSrcKey()

getUsemap

public String getUsemap()

getVspace

public String getVspace()

getWidth

public String getWidth()

isContextRelativeSet

public boolean isContextRelativeSet()

Deprecated. Use module property instead; will be removed in a release after 1.2.0.

Convenience method to return true if contextRelative set to "true".
Returns:
True if contextRelative set to "true"

isUseLocalEncoding

public boolean isUseLocalEncoding()

release

public void release()
Release any acquired resources.
Overrides:
release in interface BaseHandlerTag

setAction

public void setAction(String action)

setAlign

public void setAlign(String align)

setBorder

public void setBorder(String border)

setContextRelative

public void setContextRelative(String contextRelative)

Deprecated. Use module property instead; will be removed in a release after 1.2.0.


setHeight

public void setHeight(String height)

setHspace

public void setHspace(String hspace)

setImageName

public void setImageName(String imageName)

setIsmap

public void setIsmap(String ismap)

setLowsrc

public void setLowsrc(String lowsrc)

setModule

public void setModule(String module)

setName

public void setName(String name)

setPage

public void setPage(String page)

setPageKey

public void setPageKey(String pageKey)

setParamId

public void setParamId(String paramId)

setParamName

public void setParamName(String paramName)

setParamProperty

public void setParamProperty(String paramProperty)

setParamScope

public void setParamScope(String paramScope)

setProperty

public void setProperty(String property)

setScope

public void setScope(String scope)

setSrc

public void setSrc(String src)

setSrcKey

public void setSrcKey(String srcKey)

setUseLocalEncoding

public void setUseLocalEncoding(boolean b)

setUsemap

public void setUsemap(String usemap)

setVspace

public void setVspace(String vspace)

setWidth

public void setWidth(String width)

src

protected String src()
            throws JspException
Return the base source URL that will be rendered in the src property for this generated element, or null if there is no such URL.

srcDefaultReference

private boolean srcDefaultReference(ModuleConfig config)
Convenience method to test whether this is the default module or if contestRelative has been set.
Parameters:
config - Our Moduleconfig
Returns:
True if this is the default module or contextRelative is set

throwImgTagSrcException

private void throwImgTagSrcException()
            throws JspException
Convenience method to throw a "imgTag.src" exception.

url

protected String url(String url)
            throws JspException
Return the specified src URL, modified as necessary with optional request parameters.
Parameters:
url - The URL to be modified (or null if this url will not be used)

Copyright B) 2000-2007 - The Apache Software Foundation