Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

findAncestorWithClass() Problem

 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am unable to understand how


functions.


could somebody provide an example that explains the working of findAncestorWithClass ?
 
Piyush Joshi
Ranch Hand
Posts: 207
Eclipse IDE Firefox Browser jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its a static method in SimpleTagSupport class.

You must have read the JavaDocs for this method.

For understanding how it works, here is the source code from Tomcat implementation:


Read the code above, its pretty straightforward to see how it has been implemented (see the for loop above).

I think now you can write an example yourself. Isn't it?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic