This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi All, I really confused about the nesting between classic and simple tag. My original idea was 1. We can nest both simple and classic tag inside classic tag. 2. We can nest only simple tag inside a simple tag. 3. If we need to nest a classic tag inside a simple tag we to write adapter class.
But for the exam we only need to know point 1 & 2.
Am I correct?
Guys any help in this topic will be of great help. I not good in nested tags.
As said before, you can nest both Simple and Classic tags. But when using a Classic tag inside a Simple tag you cannot retrive this last one by using the getParent method because it will retrieve a object of type Tag. Therefore, if you use a simple tag inside a classic tag when you try to retrive the parent tag by using the same method (but now of the simple tag object) you will get a object of JspTag interface. This way you could do a cast and get a classic tag.
1 - You can retrieve a classic tag from a simple tag by using the getParent method on this object.
2 - You cannot get a simple tag from a classic by using the getParent method on this object.