org.apache.struts.taglib.html

Class ImgTag

public class ImgTag extends BaseHandlerTag

Generate an IMG tag to the specified image URI.

TODO:

Version: $Rev: 164927 $

Field Summary
protected Stringaction
The module-relative action (beginning with a slash) which will be used as the source for this image.
protected Stringalign
The property to specify where to align the image.
protected Stringborder
The border size around the image.
protected StringcontextRelative
The property to specify how to root the image.
protected Stringheight
The image height.
protected Stringhspace
The horizontal spacing around the image.
protected StringimageName
The image name for named images.
protected Stringismap
Server-side image map declaration.
protected Stringlowsrc
The low resolution image source URI.
protected static MessageResourcesmessages
The message resources for this package.
protected Stringmodule
The module prefix (beginning with a slash) which will be used to find the action for this link.
protected Stringname
The JSP bean name for query parameters.
protected Stringpage
The module-relative path, starting with a slash character, of the image to be displayed by this rendered tag.
protected StringpageKey
The message resources key under which we should look up the page attribute for this generated tag, if any.
protected StringparamId
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 StringparamName
The single-parameter JSP bean name.
protected StringparamProperty
The single-parameter JSP bean property.
protected StringparamScope
The single-parameter JSP bean scope.
protected Stringproperty
The JSP bean property name for query parameters.
protected Stringscope
The scope of the bean specified by the name property, if any.
protected Stringsrc
The image source URI.
protected StringsrcKey
The message resources key under which we should look up the src attribute for this generated tag, if any.
protected booleanuseLocalEncoding
protected Stringusemap
Client-side image map declaration.
protected Stringvspace
The vertical spacing around the image.
protected Stringwidth
The image width.
Constructor Summary
ImgTag()
Method Summary
intdoEndTag()
Render the end of the IMG tag.
intdoStartTag()
Render the beginning of the IMG tag.
StringgetAction()
StringgetAlign()
StringgetBorder()
StringgetContextRelative()
StringgetHeight()
StringgetHspace()
StringgetImageName()
StringgetIsmap()
StringgetLowsrc()
StringgetModule()
StringgetName()
StringgetPage()
StringgetPageKey()
StringgetParamId()
StringgetParamName()
StringgetParamProperty()
StringgetParamScope()
StringgetProperty()
StringgetScope()
StringgetSrc()
StringgetSrcKey()
StringgetUsemap()
StringgetVspace()
StringgetWidth()
booleanisContextRelativeSet()
Convenience method to return true if contextRelative set to "true".
booleanisUseLocalEncoding()
voidrelease()
Release any acquired resources.
voidsetAction(String action)
voidsetAlign(String align)
voidsetBorder(String border)
voidsetContextRelative(String contextRelative)
voidsetHeight(String height)
voidsetHspace(String hspace)
voidsetImageName(String imageName)
voidsetIsmap(String ismap)
voidsetLowsrc(String lowsrc)
voidsetModule(String module)
voidsetName(String name)
voidsetPage(String page)
voidsetPageKey(String pageKey)
voidsetParamId(String paramId)
voidsetParamName(String paramName)
voidsetParamProperty(String paramProperty)
voidsetParamScope(String paramScope)
voidsetProperty(String property)
voidsetScope(String scope)
voidsetSrc(String src)
voidsetSrcKey(String srcKey)
voidsetUseLocalEncoding(boolean b)
voidsetUsemap(String usemap)
voidsetVspace(String vspace)
voidsetWidth(String width)
protected Stringsrc()
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.
booleansrcDefaultReference(ModuleConfig config)
Convenience method to test whether this is the default module or if contestRelative has been set.
voidthrowImgTagSrcException()
Convenience method to throw a "imgTag.src" exception.
protected Stringurl(String url)
Return the specified src URL, modified as necessary with optional request parameters.

Field Detail

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 Detail

ImgTag

public ImgTag()

Method Detail

doEndTag

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

Throws: JspException if a JSP exception has occurred

doStartTag

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

Throws: JspException if a JSP exception has occurred

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.

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()
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.

Throws: JspException if an error occurs

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()
Convenience method to throw a "imgTag.src" exception.

Throws: JspException

url

protected String url(String url)
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)

Throws: JspException if an error occurs preparing the URL

Copyright B) 2000-2009 - The Apache Software Foundation