org.springframework.web.servlet.tags
Class NestedPathTag

java.lang.Object
  extended by TagSupport
      extended by org.springframework.web.servlet.tags.NestedPathTag

public class NestedPathTag
extends TagSupport

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!

Since:
1.1
Author:
Juergen Hoeller

Field Summary
static java.lang.String NESTED_PATH_VARIABLE_NAME
          Name of the exposed variable within the scope of this tag: "nestedPath".
private  java.lang.String path
           
private  java.lang.String previousNestedPath
          Caching a previous nested path, so that it may be reset
 
Constructor Summary
NestedPathTag()
           
 
Method Summary
 void doCatch(java.lang.Throwable throwable)
           
 int doEndTag()
          Reset any previous nestedPath value.
 void doFinally()
           
 int doStartTag()
           
 java.lang.String getPath()
          Return the path that this tag applies to.
 void setPath(java.lang.String path)
          Set the path that this tag should apply.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NESTED_PATH_VARIABLE_NAME

public static final java.lang.String NESTED_PATH_VARIABLE_NAME
Name of the exposed variable within the scope of this tag: "nestedPath".

See Also:
Constant Field Values

path

private java.lang.String path

previousNestedPath

private java.lang.String previousNestedPath
Caching a previous nested path, so that it may be reset

Constructor Detail

NestedPathTag

public NestedPathTag()
Method Detail

setPath

public void setPath(java.lang.String path)
Set the path that this tag should apply.

E.g. "customer" to allow bind paths like "address.street" rather than "customer.address.street".

See Also:
BindTag.setPath(java.lang.String)

getPath

public java.lang.String getPath()
Return the path that this tag applies to.


doStartTag

public int doStartTag()
               throws JspException
Throws:
JspException

doEndTag

public int doEndTag()
Reset any previous nestedPath value.


doCatch

public void doCatch(java.lang.Throwable throwable)
             throws java.lang.Throwable
Throws:
java.lang.Throwable

doFinally

public void doFinally()