Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help please Tags...

 
Thalys de Aguiar Gomes
Greenhorn
Posts: 15
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello javaranch staff, I would like to see if someone can help I can understand this issue of simulated ... even after you see the answer ... please if someone could explain

A custom JSP tag must be able to support an arbitrary number of attributes
whose names are unknown when the tag class is designed. Which two are true? (Choose two.)

A. The <body-content> element in the echo tag TLD must have the value JSP.
B. The echo tag handler must define the setAttribute(String key, String value) method.
C. The <dynamic-attributes>true</dynamic-attributes> element must appear in the echo tag TLD.
D. The class implementing the echo tag handler must implement the javax.servlet.jsp.tagext.IterationTag
interface.
E. The class implementing the echo tag handler must implement the javax.servlet.jsp.tagext.DynamicAttributes
interface.


the answer is: C, E
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. Can you quote your sources ?
 
Harvinder Thakur
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which book are you reading for the exam?
 
Jonathan Elkharrat
Ranch Hand
Posts: 170
Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to use dynamic attributes (atrributes not defined in TLD) you must
first add the <dynamic-attributes> in the tag TLD and set it to true.
then you must implement the javax.servlet.jsp.tagext.DynamicAttributes
inteface. this inteface have one single method:
setDynamicAttribute(String uri, String name, Object value);
this method is called whenever an "unknown" attribute is found in the tag
and the most common way to use it is to add the name-value pair to a
hashMap<String,Object>.
notice that the value is an object since dynamic attributes can get EL expressions.
(for most purpose, uri can be null...)
 
Thalys de Aguiar Gomes
Greenhorn
Posts: 15
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harvinder Thakur wrote:which book are you reading for the exam?


the book is head first servlets & jsp
&
310-083ePad.exe
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic