File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Example of Dynamic attribute in Custom Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Example of Dynamic attribute in Custom Tag " Watch "Example of Dynamic attribute in Custom Tag " New topic
Author

Example of Dynamic attribute in Custom Tag

Aaron Raja
Ranch Hand

Joined: Jun 07, 2007
Posts: 206
Only info I get about
Dynamic attribute in Custom Tag are following no example can any one give me please?
===========================================================
Dynamic attributes
Simple tags and classic tags can handle dynamic attributes. Two things are necessary to allow dynamic attributes in custom tags :
􀂃 Declare dynamic attributes in DD;
􀂃 Implement DynamicAttributes interface.
DD declaration
To declare the use of dynamic attributes, one element must be added in the tag definition :
<dynamic-attributes>true</dynamic-attributes>
Custom tag class
The corresponding custom tag class must implement the DynamicAttributes class, which defines one method :
public void setDynamicAttribute(String uri, String localName, Object value) throws JspException
Most common implementation is to store the attributes in a <String, Object> map with the localName as key, and the value object as value.

Thanks
AR


Thanks, AR
SCWCD 5, SCJP 1.4, OCA (PL/SQL)
Nikos Pougounias
Ranch Hand

Joined: Jan 16, 2008
Posts: 110
Hi Aaron,

These tutorials, I've created, have practical examples for dynamic attributes as well: Skills for Tag Files, Skills for Simple Tag handlers, and Skills for Custom Tag handlers.

Also, there is an excellent post here in JavaRanch, by the co-author of HFSJ.

Thanks,
Nikos


Nikos' Java blog
 
wood burning stoves
 
subject: Example of Dynamic attribute in Custom Tag
 
Similar Threads
help please Tags...
Custom Tag
Dynamic attribute
DynamicAttributes interface
Tutorial on Dynamic Attributes