|
The Spring Framework | |||||||||
| 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
public abstract class AbstractDataBoundFormElementTag
Base tag for all data-binding aware JSP form tags.
Provides the common path and id properties.
Provides sub-classes with utility methods for accessing the BindStatus
of their bound value and also for interacting
with the TagWriter.
| Field Summary | |
|---|---|
static String |
COMMAND_NAME_ATTRIBUTE
The name of the ' commandName' attribute. |
static String |
COMMAND_NAME_VARIABLE_NAME
The name of the PageContext attribute under which the
command object name is exposed. |
static String |
ID_ATTRIBUTE
The ' id' attribute of the rendered HTML tag. |
| 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 | |
|---|---|
AbstractDataBoundFormElementTag()
|
|
| Method Summary | |
|---|---|
protected String |
autogenerateId()
Autogenerate the ' id' attribute value for this tag. |
void |
doFinally()
Disposes of the BindStatus instance. |
protected BindStatus |
getBindStatus()
Get the BindStatus for this tag. |
protected Object |
getBoundValue()
Get the bound value. |
protected String |
getCompletePath()
Build the complete path for this tag, including the nested path. |
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 the NestedPathTag. |
protected String |
getPath()
Get the resolved property path for the
command object. |
protected PropertyEditor |
getPropertyEditor()
Get the PropertyEditor, if any, in use for value bound to this tag. |
void |
setId(String id)
Set the value of the ' id' attribute. |
void |
setPath(String path)
Set the property path from the command object. |
protected void |
writeDefaultAttributes(TagWriter tagWriter)
Writes the default set of attributes to the supplied TagWriter. |
| Methods inherited from class org.springframework.web.servlet.tags.form.AbstractFormTag |
|---|
createTagWriter, doStartTagInternal, evaluate, getDisplayString, getDisplayString, writeOptionalAttribute, writeTagContent |
| 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, doEndTag, 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 String ID_ATTRIBUTE
id' attribute of the rendered HTML tag.
public static final String COMMAND_NAME_ATTRIBUTE
commandName' attribute.
public static final String COMMAND_NAME_VARIABLE_NAME
PageContext attribute under which the
command object name is exposed.
| Constructor Detail |
|---|
public AbstractDataBoundFormElementTag()
| Method Detail |
|---|
public void setPath(String path)
command object.
May be a runtime expression. Required.
protected final String getPath()
throws JspException
resolved property path for the
command object.
JspExceptionpublic void setId(String id)
id' attribute.
Defaults to the value of getName(); may be a runtime expression.
Note that the default value may not be valid for certain tags.
setId in class TagSupportpublic String getId()
id' attribute.
May be a runtime expression.
getId in class TagSupport
protected void writeDefaultAttributes(TagWriter tagWriter)
throws JspException
TagWriter.
Further abstract sub-classes should override this method to add in
any additional default attributes but must remember
to call the super method.
Concrete sub-classes should call this method when/if they want to render default attributes.
tagWriter - the TagWriter to which any attributes are to be written
JspException
protected String autogenerateId()
throws JspException
id' attribute value for this tag.
The default implementation simply delegates to getName().
JspException
protected String getName()
throws JspException
name' attribute.
The default implementation simply delegates to
getCompletePath() to use the property path as the name.
For the most part this is desirable as it links with the server-side
expectation for databinding. However, some subclasses may wish to change
the value of the 'name' attribute without changing the bind path.
name' attribute
JspException
protected final Object getBoundValue()
throws JspException
JspExceptiongetBindStatus()
protected PropertyEditor getPropertyEditor()
throws JspException
PropertyEditor, if any, in use for value bound to this tag.
JspException
protected BindStatus getBindStatus()
throws JspException
BindStatus for this tag.
JspExceptionprotected String getNestedPath()
NestedPathTag.
protected String getCompletePath()
throws JspException
JspExceptiongetNestedPath(),
getPath()public void doFinally()
BindStatus instance.
doFinally in interface TryCatchFinallydoFinally in class RequestContextAwareTag
|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||