DynamicAttributes (Java EE 5)

Java EE API


javax.servlet.jsp.tagext Interface DynamicAttributes


public interface DynamicAttributes


声明接受动态属性的标记必须实现此接口。还必须配置标记库描述符中该标记的条目,以指示接受动态属性。
对于此标记的标记库描述符中未声明的任何属性,将使用该属性的名称和值调用 setDynamicAttribute() 方法,而不是在转换期间出现错误。由标记负责记住动态属性的名称和值。
英文文档:

For a tag to declare that it accepts dynamic attributes, it must implement this interface. The entry for the tag in the Tag Library Descriptor must also be configured to indicate dynamic attributes are accepted.
For any attribute that is not declared in the Tag Library Descriptor for this tag, instead of getting an error at translation time, the setDynamicAttribute() method is called, with the name and value of the attribute. It is the responsibility of the tag to remember the names and values of the dynamic attributes.

Since:
JSP 2.0

Method Summary
 void
 

Method Detail

public void setDynamicAttribute(String uri, String localName, Object value) throws JspException
在将标记库描述符中未声明的属性传递给声明接受动态属性的标记时调用。
uri 属性的名称空间,如果在默认名称空间中,则该参数为 null。
localName 要设置的属性的名称。
value 属性的值
ThrowsJspException: 如果标记处理程序想要表示它不接受给定属性。容器不得为此标记调用 doStartTag() 或 doTag()。
英文文档:

setDynamicAttribute

void setDynamicAttribute(String uri,
                         String localName,
                         Object value)
                         throws JspException
Called when a tag declared to accept dynamic attributes is passed an attribute that is not declared in the Tag Library Descriptor.

Parameters:
uri - the namespace of the attribute, or null if in the default namespace.
localName - the name of the attribute being set.
value - the value of the attribute
Throws:
JspException - if the tag handler wishes to signal that it does not accept the given attribute. The container must not call doStartTag() or doTag() for this tag.


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!