类 AbstractDataBoundFormElementTag
- java.lang.Object
- javax.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
- 所有已实现的接口:
Serializable
,IterationTag
,JspTag
,Tag
,TryCatchFinally
,EditorAwareTag
- 直接已知子类:
AbstractHtmlElementTag
public abstract class AbstractDataBoundFormElementTag extends AbstractFormTag implements EditorAwareTag
Base tag for all data-binding aware JSP form tags.Provides the common
path
andid
properties. Provides sub-classes with utility methods for accessing theBindStatus
of their bound value and also forinteracting
with theTagWriter
.- 从以下版本开始:
- 2.0
- 作者:
- Rob Harrop, Juergen Hoeller
- 另请参阅:
- 序列化表格
字段概要
字段 修饰符和类型 字段 说明 protected static String
NESTED_PATH_VARIABLE_NAME
Name of the exposed path variable within the scope of this tag: "nestedPath".从类继承的字段 org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
从类继承的字段 javax.servlet.jsp.tagext.TagSupport
pageContext
从接口继承的字段 javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
从接口继承的字段 javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
构造器概要
构造器 构造器 说明 AbstractDataBoundFormElementTag()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected String
autogenerateId()
Autogenerate the 'id
' attribute value for this tag.protected String
convertToDisplayString(Object value)
Get a display String for the given value, converted by a PropertyEditor that the BindStatus may have registered for the value's Class.void
doFinally()
Disposes of theBindStatus
instance.protected BindStatus
getBindStatus()
Get theBindStatus
for this tag.protected Object
getBoundValue()
Get the bound value.PropertyEditor
getEditor()
Exposes thePropertyEditor
forEditorAwareTag
.String
getId()
Get the value of the 'id
' attribute.protected String
getName()
Get the value for the HTML 'name
' attribute.protected String
getNestedPath()
Get the value of the nested path that may have been exposed by theNestedPathTag
.protected String
getPath()
Get theresolved
property path for theform object
.protected PropertyEditor
getPropertyEditor()
Get thePropertyEditor
, if any, in use for value bound to this tag.protected String
getPropertyPath()
Build the property path for this tag, including the nested path but not prefixed with the name of the form attribute.protected String
processFieldValue(String name, String value, String type)
Process the given form field through aRequestDataValueProcessor
instance if one is configured or otherwise returns the same value.protected String
resolveId()
Determine the 'id
' attribute value for this tag, autogenerating one if none specified.void
setId(String id)
Set the value of the 'id
' attribute.void
setPath(String path)
Set the property path from theform object
.protected void
writeDefaultAttributes(TagWriter tagWriter)
Writes the default set of attributes to the suppliedTagWriter
.从类继承的方法 org.springframework.web.servlet.tags.form.AbstractFormTag
createTagWriter, doStartTagInternal, evaluate, getDisplayString, getDisplayString, isDefaultHtmlEscape, writeOptionalAttribute, writeTagContent
从类继承的方法 org.springframework.web.servlet.tags.HtmlEscapingAwareTag
htmlEscape, isHtmlEscape, isResponseEncodedHtmlEscape, setHtmlEscape
从类继承的方法 org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doStartTag, getRequestContext
从类继承的方法 javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
字段详细资料
NESTED_PATH_VARIABLE_NAME
protected static final String NESTED_PATH_VARIABLE_NAME
Name of the exposed path variable within the scope of this tag: "nestedPath". Same value asNestedPathTag.NESTED_PATH_VARIABLE_NAME
.- 另请参阅:
- 常量字段值
构造器详细资料
AbstractDataBoundFormElementTag
public AbstractDataBoundFormElementTag()
方法详细资料
setPath
public void setPath(String path)
Set the property path from theform object
. May be a runtime expression.
getPath
protected final String getPath() throws JspException
Get theresolved
property path for theform object
.- 抛出:
JspException
setId
public void setId(String id)
Set the value of the 'id
' attribute.May be a runtime expression; defaults to the value of
getName()
. Note that the default value may not be valid for certain tags.- 覆盖:
setId
在类中TagSupport
getId
public String getId()
Get the value of the 'id
' attribute.- 覆盖:
getId
在类中TagSupport
writeDefaultAttributes
protected void writeDefaultAttributes(TagWriter tagWriter) throws JspException
Writes the default set of attributes to the suppliedTagWriter
. Further abstract sub-classes should override this method to add in any additional default attributes but must remember to call thesuper
method.Concrete sub-classes should call this method when/if they want to render default attributes.
- 参数:
tagWriter
- theTagWriter
to which any attributes are to be written- 抛出:
JspException
resolveId
protected String resolveId() throws JspException
Determine the 'id
' attribute value for this tag, autogenerating one if none specified.- 抛出:
JspException
- 另请参阅:
getId()
,autogenerateId()
autogenerateId
protected String autogenerateId() throws JspException
Autogenerate the 'id
' attribute value for this tag.The default implementation simply delegates to
getName()
, deleting invalid characters (such as "[" or "]").- 抛出:
JspException
getName
protected String getName() throws JspException
Get the value for the HTML 'name
' attribute.The default implementation simply delegates to
getPropertyPath()
to use the property path as the name. For the most part this is desirable as it links with the server-side expectation for data binding. However, some subclasses may wish to change the value of the 'name
' attribute without changing the bind path.- 返回:
- the value for the HTML '
name
' attribute - 抛出:
JspException
getBindStatus
protected BindStatus getBindStatus() throws JspException
Get theBindStatus
for this tag.- 抛出:
JspException
getNestedPath
protected String getNestedPath()
Get the value of the nested path that may have been exposed by theNestedPathTag
.
getPropertyPath
protected String getPropertyPath() throws JspException
Build the property path for this tag, including the nested path but not prefixed with the name of the form attribute.- 抛出:
JspException
- 另请参阅:
getNestedPath()
,getPath()
getBoundValue
protected final Object getBoundValue() throws JspException
Get the bound value.- 抛出:
JspException
- 另请参阅:
getBindStatus()
getPropertyEditor
protected PropertyEditor getPropertyEditor() throws JspException
Get thePropertyEditor
, if any, in use for value bound to this tag.- 抛出:
JspException
getEditor
public final PropertyEditor getEditor() throws JspException
Exposes thePropertyEditor
forEditorAwareTag
.Use
getPropertyEditor()
for internal rendering purposes.- 指定者:
getEditor
在接口中EditorAwareTag
- 返回:
- the current PropertyEditor, or
null
if none - 抛出:
JspException
- if resolving the editor failed
convertToDisplayString
protected String convertToDisplayString(Object value) throws JspException
Get a display String for the given value, converted by a PropertyEditor that the BindStatus may have registered for the value's Class.- 抛出:
JspException
processFieldValue
protected final String processFieldValue(String name, String value, String type)
Process the given form field through aRequestDataValueProcessor
instance if one is configured or otherwise returns the same value.
doFinally
public void doFinally()
Disposes of theBindStatus
instance.- 指定者:
doFinally
在接口中TryCatchFinally
- 覆盖:
doFinally
在类中RequestContextAwareTag