net.sourceforge.stripes.tag
Class InputImageTag

java.lang.Object
  extended by net.sourceforge.stripes.tag.StripesTagSupport
      extended by net.sourceforge.stripes.tag.HtmlTagSupport
          extended by net.sourceforge.stripes.tag.InputTagSupport
              extended by net.sourceforge.stripes.tag.InputImageTag
All Implemented Interfaces:
DynamicAttributes, JspTag, Tag, TryCatchFinally

public class InputImageTag
extends InputTagSupport

Tag class that generates an image button for use in HTML forms, e.g:

<input name="foo" type="image" src="/app/foo.gif" alt="foo"/>

Provides a couple of facilities above and beyond using plain HTML tags. The main advantage is a localization capability. The tag looks in the Stripes Field Name message bundle for resources to be used as the src URL for the image and the alt text of the image. In order it will look for and use:

If localized values exist these are preferred over the values specified directly on the tag.

Additionally if the 'src' URL (whether acquired from the tag attribute or the resource bundle) starts with a slash, the tag will prepend the context path of the web application.

Since:
Stripes 1.3
Author:
Tim Fennell

Field Summary
 
Fields inherited from class net.sourceforge.stripes.tag.InputTagSupport
errorRenderer, fieldErrors
 
Fields inherited from class net.sourceforge.stripes.tag.StripesTagSupport
pageContext, parentTag
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
InputImageTag()
          Sets the tag's type to be an image input.
 
Method Summary
 int doEndInputTag()
          Does the major work of the tag as described in the class level javadoc.
 int doStartInputTag()
          Does nothing.
 String getAlign()
           
 String getAlt()
           
 String getSrc()
           
 String getValue()
           
 void setAlign(String align)
           
 void setAlt(String alt)
           
 void setSrc(String src)
           
 void setValue(String value)
           
 
Methods inherited from class net.sourceforge.stripes.tag.InputTagSupport
doCatch, doEndTag, doFinally, doStartTag, format, format, getActionBean, getDisabled, getFieldErrors, getFormatPattern, getFormatType, getLocalizedFieldName, getLocalizedFieldName, getName, getOverrideValueOrValues, getParentFormTag, getReadonly, getSingleOverrideValue, getSize, getValidationMetadata, getValueOnPage, hasErrors, isItemSelected, loadErrors, makeFocused, registerWithParentForm, setDisabled, setFocus, setFormatPattern, setFormatType, setName, setReadonly, setSize
 
Methods inherited from class net.sourceforge.stripes.tag.HtmlTagSupport
evaluateExpression, get, getAccesskey, getAttributes, getBodyContent, getBodyContentAsString, getCssClass, getDir, getId, getLang, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getStyle, getTabindex, getTitle, release, set, setAccesskey, setBodyContent, setClass, setCssClass, setDir, setDynamicAttribute, setId, setLang, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setStyle, setTabindex, setTitle, toString, writeAttributes, writeCloseTag, writeOpenTag, writeSingletonTag
 
Methods inherited from class net.sourceforge.stripes.tag.StripesTagSupport
getActionBeanType, getActionBeanUrl, getPageContext, getParent, getParentTag, getTagStack, popPageContextAttributes, pushPageContextAttributes, setPageContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InputImageTag

public InputImageTag()
Sets the tag's type to be an image input.

Method Detail

doStartInputTag

public int doStartInputTag()
                    throws JspException
Does nothing.

Specified by:
doStartInputTag in class InputTagSupport
Returns:
SKIP_BODY in all cases
Throws:
JspException

doEndInputTag

public int doEndInputTag()
                  throws JspException
Does the major work of the tag as described in the class level javadoc. Checks for localized src and alt attributes and prepends the context path to any src URL that starts with a slash.

Specified by:
doEndInputTag in class InputTagSupport
Returns:
EVAL_PAGE always
Throws:
JspException

setAlign

public void setAlign(String align)

getAlign

public String getAlign()

setAlt

public void setAlt(String alt)

getAlt

public String getAlt()

setSrc

public void setSrc(String src)

getSrc

public String getSrc()

setValue

public void setValue(String value)

getValue

public String getValue()


? Copyright 2005-2006, Stripes Development Team.