• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tag Extensions

 
Kamal Tripathi
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1) Parents Topic

as per what I understood is that simple tags can take both simple as well as classic tags as parents but for classic tags to have simple tags as parents, we might need to use Tag Adapter class.

I wanted to know if for exam considerations.



This is a valid combination ??? Since HFSJ didn't discuss TagAdapter classes, I was of impression that this should not be considered a valid option per exam objectives.

2) Body-Content

JSPFragments don't support scripting so that means that we can't pass on scriptlets in the body of SimpleTag? And webapp won't be deployed if in the TLD I set <body-content> value to be JSP ??

What about ClassicTags. It is not possible to find out from the TLD whether a tag is simple or classic one so how would the entry of JSP for <body-content> be invalidated only for SimpleTags
 
Poonam Agarwal
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Parents Topic



Yes this a valid combination. simpleTags can have classic parents and classicTag can also have simpleTag as their parent , but for that it require little extra work. TagAdapter will do the work for you. beacuse classicTag's getParent() method returns the Tag , but simpleTag 's getParent() methos retuens the JspTag. so extra work is needed here to type cast the Tag to JspTag.

Please refer to the JSP specification 2.0 for more detail
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic