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

findAcestorWithClass() method

 
Rina Magro
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
In Heads First Servlets n JSP , page 544 it says this re findAcestorWithClass() method:
The method is in both TagSupport and SimpleTagSupport (altough they have slightly different behaviour)

Can somebody please explain what this slight different behaviour is cos I'm a bit confused with that little phrase as there is no explanation after it.

Thanks lots
Regards
Rina
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rina,
on page 540 they explain this point.
 
Rina Magro
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael
I think i understand now.
The method from SimpleTagSupport returns JspTag n has this signature:
JspTag findAncestorWithClass(JspTag from, java.lang.Class c) while that from TagSupport has this signature:
Tag findAncestorWithClass(Tag from, java.lang.Class c)
The difference arises when a classic tag finds a simple tag ancestor and the problem with casting arises.
Is this the difference please?
Thanks lots
Rina
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Very Good!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic