public class NestedPathTag
extends javax.servlet.jsp.tagext.TagSupport
implements javax.servlet.jsp.tagext.TryCatchFinally
Nested-path tag, to support and assist with nested beans or bean properties in the model. Exports a "nestedPath" variable of type String in request scope, visible to the current page and also included pages, if any.
The BindTag will auto-detect the current nested path and automatically prepend it to its own path to form a complete path to the bean or bean property.
This tag will also prepend any existing nested path that is currently set. Thus, you can nest multiple nested-path tags.
Thanks to Seth Ladd for the suggestion and the original implementation!
Modifier and Type | Field and Description |
---|---|
static String |
NESTED_PATH_VARIABLE_NAME
Name of the exposed variable within the scope of this tag: "nestedPath".
|
Constructor and Description |
---|
NestedPathTag() |
Modifier and Type | Method and Description |
---|---|
void |
doCatch(Throwable throwable) |
int |
doEndTag()
Reset any previous nestedPath value.
|
void |
doFinally() |
int |
doStartTag() |
String |
getPath()
Return the path that this tag applies to.
|
void |
setPath(String path)
Set the path that this tag should apply.
|
public static final String NESTED_PATH_VARIABLE_NAME
public void setPath(String path)
E.g. "customer" to allow bind paths like "address.street" rather than "customer.address.street".
BindTag.setPath(java.lang.String)
public String getPath()
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
public int doEndTag()
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.TagSupport
public void doCatch(Throwable throwable) throws Throwable
doCatch
in interface javax.servlet.jsp.tagext.TryCatchFinally
Throwable
public void doFinally()
doFinally
in interface javax.servlet.jsp.tagext.TryCatchFinally
Copyright © 2015. All rights reserved.