|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
org.springframework.web.servlet.tags.RequestContextAwareTag
org.springframework.web.servlet.tags.HtmlEscapingAwareTag
org.springframework.web.servlet.tags.form.AbstractFormTag
org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
org.springframework.web.servlet.tags.form.FormTag
public class FormTag
Databinding-aware JSP tag for rendering an HTML 'form
' whose
inner elements are bound to properties on a form object.
Users should place the form object into the
ModelAndView
when
populating the data for their view. The name of this form object can be
configured using the "modelAttribute"
property.
The default value for the "modelAttribute"
property is 'command
' which corresponds to the default name
when using the
SimpleFormController
.
SimpleFormController
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
DEFAULT_COMMAND_NAME
The default attribute name: "command" |
static java.lang.String |
MODEL_ATTRIBUTE_VARIABLE_NAME
The name of the PageContext attribute under which the
form object name is exposed. |
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag |
---|
CLASS_ATTRIBUTE, DIR_ATTRIBUTE, LANG_ATTRIBUTE, ONCLICK_ATTRIBUTE, ONDBLCLICK_ATTRIBUTE, ONKEYDOWN_ATTRIBUTE, ONKEYPRESS_ATTRIBUTE, ONKEYUP_ATTRIBUTE, ONMOUSEDOWN_ATTRIBUTE, ONMOUSEMOVE_ATTRIBUTE, ONMOUSEOUT_ATTRIBUTE, ONMOUSEOVER_ATTRIBUTE, ONMOUSEUP_ATTRIBUTE, STYLE_ATTRIBUTE, TABINDEX_ATTRIBUTE, TITLE_ATTRIBUTE |
Fields inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag |
---|
COMMAND_NAME_VARIABLE_NAME, NESTED_PATH_VARIABLE_NAME |
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag |
---|
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
pageContext |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
FormTag()
|
Method Summary | |
---|---|
protected java.lang.String |
autogenerateId()
Autogenerated IDs correspond to the form object name. |
int |
doEndTag()
Closes the ' form ' block tag and removes the form object name
from the PageContext . |
void |
doFinally()
Clears the stored TagWriter . |
protected java.lang.String |
getAcceptCharset()
Get the value of the ' acceptCharset ' attribute. |
protected java.lang.String |
getAction()
Get the value of the ' action ' attribute. |
protected java.lang.String |
getAutocomplete()
Get the value of the ' autocomplete ' attribute. |
protected java.lang.String |
getCommandName()
Get the name of the form attribute in the model. |
protected java.lang.String |
getEnctype()
Get the value of the ' enctype ' attribute. |
protected java.lang.String |
getMethod()
Get the value of the ' method ' attribute. |
protected java.lang.String |
getModelAttribute()
Get the name of the form attribute in the model. |
protected java.lang.String |
getName()
Get the value of the ' name ' attribute. |
protected java.lang.String |
getOnreset()
Get the value of the ' onreset ' attribute. |
protected java.lang.String |
getOnsubmit()
Get the value of the ' onsubmit ' attribute. |
java.lang.String |
getTarget()
Get the value of the ' target ' attribute. |
protected java.lang.String |
resolveAction()
Resolve the value of the ' action ' attribute. |
protected java.lang.String |
resolveCssClass()
Override resolve CSS class since error class is not supported. |
protected java.lang.String |
resolveModelAttribute()
Resolves and returns the name of the form object. |
void |
setAcceptCharset(java.lang.String acceptCharset)
Set the value of the ' acceptCharset ' attribute. |
void |
setAction(java.lang.String action)
Set the value of the ' action ' attribute. |
void |
setAutocomplete(java.lang.String autocomplete)
Set the value of the ' autocomplete ' attribute. |
void |
setCommandName(java.lang.String commandName)
Set the name of the form attribute in the model. |
void |
setCssErrorClass(java.lang.String cssErrorClass)
Unsupported for forms. |
void |
setEnctype(java.lang.String enctype)
Set the value of the ' enctype ' attribute. |
void |
setMethod(java.lang.String method)
Set the value of the ' method ' attribute. |
void |
setModelAttribute(java.lang.String modelAttribute)
Set the name of the form attribute in the model. |
void |
setName(java.lang.String name)
Set the value of the ' name ' attribute. |
void |
setOnreset(java.lang.String onreset)
Set the value of the ' onreset ' attribute. |
void |
setOnsubmit(java.lang.String onsubmit)
Set the value of the ' onsubmit ' attribute. |
void |
setPath(java.lang.String path)
Unsupported for forms. |
void |
setTarget(java.lang.String target)
Set the value of the ' target ' attribute. |
protected int |
writeTagContent(TagWriter tagWriter)
Writes the opening part of the block ' form ' tag and exposes
the form object name in the PageContext . |
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag |
---|
getCssClass, getCssErrorClass, getCssStyle, getDir, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getTabindex, getTitle, setCssClass, setCssStyle, setDir, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setTabindex, setTitle, writeDefaultAttributes, writeOptionalAttributes |
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag |
---|
getBindStatus, getBoundValue, getEditor, getId, getNestedPath, getPath, getPropertyEditor, getPropertyPath, resolveId, setId |
Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag |
---|
createTagWriter, doStartTagInternal, evaluate, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute |
Methods inherited from class org.springframework.web.servlet.tags.HtmlEscapingAwareTag |
---|
isHtmlEscape, setHtmlEscape |
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag |
---|
doCatch, doStartTag, getRequestContext |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
doAfterBody, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_COMMAND_NAME
public static final java.lang.String MODEL_ATTRIBUTE_VARIABLE_NAME
PageContext
attribute under which the
form object name is exposed.
Constructor Detail |
---|
public FormTag()
Method Detail |
---|
public void setModelAttribute(java.lang.String modelAttribute)
May be a runtime expression.
protected java.lang.String getModelAttribute()
public void setCommandName(java.lang.String commandName)
May be a runtime expression.
setModelAttribute(java.lang.String)
protected java.lang.String getCommandName()
getModelAttribute()
public void setName(java.lang.String name)
name
' attribute.
May be a runtime expression.
Name is not a valid attribute for form on XHTML 1.0. However, it is sometimes needed for backward compatibility.
protected java.lang.String getName() throws javax.servlet.jsp.JspException
name
' attribute.
getName
in class AbstractDataBoundFormElementTag
name
' attribute
javax.servlet.jsp.JspException
public void setAction(java.lang.String action)
action
' attribute.
May be a runtime expression.
protected java.lang.String getAction()
action
' attribute.
public void setMethod(java.lang.String method)
method
' attribute.
May be a runtime expression.
protected java.lang.String getMethod()
method
' attribute.
public void setTarget(java.lang.String target)
target
' attribute.
May be a runtime expression.
public java.lang.String getTarget()
target
' attribute.
public void setEnctype(java.lang.String enctype)
enctype
' attribute.
May be a runtime expression.
protected java.lang.String getEnctype()
enctype
' attribute.
public void setAcceptCharset(java.lang.String acceptCharset)
acceptCharset
' attribute.
May be a runtime expression.
protected java.lang.String getAcceptCharset()
acceptCharset
' attribute.
public void setOnsubmit(java.lang.String onsubmit)
onsubmit
' attribute.
May be a runtime expression.
protected java.lang.String getOnsubmit()
onsubmit
' attribute.
public void setOnreset(java.lang.String onreset)
onreset
' attribute.
May be a runtime expression.
protected java.lang.String getOnreset()
onreset
' attribute.
public void setAutocomplete(java.lang.String autocomplete)
autocomplete
' attribute.
May be a runtime expression.
protected java.lang.String getAutocomplete()
autocomplete
' attribute.
protected int writeTagContent(TagWriter tagWriter) throws javax.servlet.jsp.JspException
form
' tag and exposes
the form object name in the PageContext
.
writeTagContent
in class AbstractFormTag
tagWriter
- the TagWriter
to which the form content is to be written
Tag.EVAL_BODY_INCLUDE
javax.servlet.jsp.JspException
protected java.lang.String autogenerateId() throws javax.servlet.jsp.JspException
autogenerateId
in class AbstractDataBoundFormElementTag
javax.servlet.jsp.JspException
protected java.lang.String resolveModelAttribute() throws javax.servlet.jsp.JspException
Resolves
and returns the name of the form object.
java.lang.IllegalArgumentException
- if the form object resolves to null
javax.servlet.jsp.JspException
protected java.lang.String resolveAction() throws javax.servlet.jsp.JspException
action
' attribute.
If the user configured an 'action
' value then
the result of evaluating this value is used. Otherwise, the
originating URI
is used.
action
' attribute
javax.servlet.jsp.JspException
public int doEndTag() throws javax.servlet.jsp.JspException
form
' block tag and removes the form object name
from the PageContext
.
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
public void doFinally()
TagWriter
.
doFinally
in interface javax.servlet.jsp.tagext.TryCatchFinally
doFinally
in class AbstractDataBoundFormElementTag
protected java.lang.String resolveCssClass() throws javax.servlet.jsp.JspException
resolveCssClass
in class AbstractHtmlElementTag
javax.servlet.jsp.JspException
public void setPath(java.lang.String path)
setPath
in class AbstractDataBoundFormElementTag
java.lang.UnsupportedOperationException
- alwayspublic void setCssErrorClass(java.lang.String cssErrorClass)
setCssErrorClass
in class AbstractHtmlElementTag
java.lang.UnsupportedOperationException
- always
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |