net.sourceforge.stripes.tag
Class InputHiddenTag
java.lang.Object
net.sourceforge.stripes.tag.StripesTagSupport
net.sourceforge.stripes.tag.HtmlTagSupport
net.sourceforge.stripes.tag.InputTagSupport
net.sourceforge.stripes.tag.InputHiddenTag
- All Implemented Interfaces:
- BodyTag, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally
public class InputHiddenTag
- extends InputTagSupport
- implements BodyTag
Generates one or more <input type="hidden" ... /> HTML tags based on the value
supplied. The hidden tag assigns the value attribute by scanning in the following order:
- for one or more values with the same name in the HttpServletRequest
- for a field on the ActionBean with the same name (if a bean instance is present)
- by collapsing the body content to a String, if a body is present
- referring to the result of the EL expression contained in the value attribute of the tag.
The result of this scan can produce either a Collection, an Array or any other Object. In the
first two cases the tag will output an HTML hidden form field tag for each value in the
Collection or Array. In all other cases the Object is toString()'d (unless it is null) and a
single hidden field will be written.
- Author:
- Tim Fennell
Constructor Summary |
InputHiddenTag()
Basic constructor that sets the input tag's type attribute to "hidden". |
Method Summary |
int |
doAfterBody()
Does nothing. |
int |
doEndInputTag()
Determines the value(s) that will be used for the tag and then proceeds to generate
one or more hidden fields to contain those values. |
void |
doInitBody()
Does nothing. |
int |
doStartInputTag()
Sets the tag up as a hidden tag. |
Object |
getValue()
Returns the value set with setValue(). |
void |
setValue(Object value)
Sets the value that will be used for the hidden field(s) if no body or repopulation
value is found. |
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 |
InputHiddenTag
public InputHiddenTag()
- Basic constructor that sets the input tag's type attribute to "hidden".
setValue
public void setValue(Object value)
- Sets the value that will be used for the hidden field(s) if no body or repopulation
value is found.
- Parameters:
value
- the result of an EL evaluation, can be a Collection, Array or other.
getValue
public Object getValue()
- Returns the value set with setValue().
doStartInputTag
public int doStartInputTag()
throws JspException
- Sets the tag up as a hidden tag.
- Specified by:
doStartInputTag
in class InputTagSupport
- Returns:
- EVAL_BODY_BUFFERED to always buffer the body (so it can be used as the value)
- Throws:
JspException
doInitBody
public void doInitBody()
throws JspException
- Does nothing.
- Specified by:
doInitBody
in interface BodyTag
- Throws:
JspException
doAfterBody
public int doAfterBody()
throws JspException
- Does nothing.
- Specified by:
doAfterBody
in interface IterationTag
- Returns:
- SKIP_BODY in all cases.
- Throws:
JspException
doEndInputTag
public int doEndInputTag()
throws JspException
- Determines the value(s) that will be used for the tag and then proceeds to generate
one or more hidden fields to contain those values.
- Specified by:
doEndInputTag
in class InputTagSupport
- Returns:
- EVAL_PAGE in all cases.
- Throws:
JspException
- if the enclosing form tag cannot be found, or output cannot be written.
? Copyright 2005-2006, Stripes Development Team.