Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

nested custom Tag problem

 
Gil Li
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello people
i wrote a nested JSP custom tag file.when I compile the inner tag java file, it shows the compilation error as

C:\tomcat-4.1.29\webapps\examples\WEB-INF\classes\tagExamples\inTag.java:20: cannot resolve symbol
symbol : class nameTagHandler
location: class tagExamples.inTag
nameTagHandler parent =(nameTagHandler)findAncestorWithClass(this, nameTagHandler.class);

I have given below the inner tag java file. nameTagHandler file compiled successfully.both are in same tagExamples package.Help me.


package tagExamples;

import java.io.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;

public class inTag extends BodyTagSupport
{






public int doStartTag() throws JspTagException
{
try
{

JspWriter out=pageContext.getOut();
nameTagHandler parent =(nameTagHandler)findAncestorWithClass(this, nameTagHandler.class);

out.println(parent.getName());




}catch(Exception e){System.out.println("start "+e.toString());}
return(EVAL_BODY_INCLUDE);

}



}
 
I've never won anything before. Not even a tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!