Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extermely hard to read and many people that might be able to help you will just move along. Please read this for more information.
Originally posted by Ken Sampson:
<mine:Simple> <mine:Classic /> </mine:Classic>
This syntax is not valid. You have self-closed the "classic" tag and supplied a closing tag. Do one or the other.
Classic tags certainly can have Simple tags as parents. Your code looks basically correct. Looking at your error message, though, my first suspicion would be that in your TLD, for Simple tag you have <body-content>empty</body-content> instead of "scriptless".
Joined: Sep 26, 2007
Thank you John for your reply ..for your reference please find the TLD file below:
Please let me know if I am doing anything wrong [ May 14, 2008: Message edited by: Ken Sampson ]
Joined: Oct 19, 2007
Well, I'm baffled. Your TLD looks good, your code looks good. I decided to try it myself, cutting and pasting your code snippets. I had to add declarations for nestedLevel and write, but I know you've got those in there or it wouldn't have compiled. When I ran it, it worked just fine! It produced the output: Tag at nestedLevel 0 1.
I guess what I would try at this point is to comment out everything in doStartTag() except the return, and see if that gets rid of the error. If it does, start adding code back in a line or two at a time.
I can't help but think that a bad.bodycontent.type error is a syntax problem in the TLD or JSP page, but I sure don't see any problems in what you've posted.
I haven't tested this, and obviously there is a fault in your TLD (the "scripless" instead of "scriptless") but if you look at the documentation, TagSupport and BodyTagSupport store parent as a "tag" where as SimpleTags store it as "JspTag". So if you know the class family tree, you'd know that this means that Simple tags can have any tag as it's parent (JspTag is the base class) While Tags would only allow other Tags as a SimpleTag can not be stored in a Tag variable.