I am learning how nested beans works. The code I am running is fine except the doEngTag() are NOT invoked in any of the tag handlers.
--
jsp file --
<%@ taglib uri="outerTagExample" prefix="ot" %>
<%@ taglib uri="getParentTag" prefix="gpt" %>
<html><head>
<ot

uterTag count="99">
<gpt:getParentTag/>
</ot

uterTag>
</body></html>
------------
--- OuterTag.java
package coreservlets.tags;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.io.*;
public class OuterTag extends TagSupport
{
private int count;
JspWriter out ;
public int doStartTag()
{
out = pageContext.getOut();
try{ out.print("Count==>"+count); }
catch(Exception e){ }
return EVAL_BODY_INCLUDE;
}
public void setCount(int count) {this.count = count; }
public int getCount() {return this.count; }
public int doAfterBody() {return EVAL_BODY_INCLUDE; }
public int doEngTag() throws JspException, IOException
{
out.print("OuterTag class of doEngTag() Done.");
System.out.println("OuterTag class , doEngTag() -- Done.");
return SKIP_PAGE;
}
}
-- GetParentTag.java --
package coreservlets.tags;
import java.io.IOException;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
public class GetParentTag extends TagSupport
{
JspWriter out;
public int doStartTag()
{
OuterTag parent = (OuterTag)this.getParent();
JspWriter out = pageContext.getOut();
try{ out.print("Count value of parent ="+parent.getCount());
}catch(Exception e){ }
return EVAL_BODY_INCLUDE;
}
public int doAfterBody() { return EVAL_BODY_INCLUDE; }
public int doEngTag() throws JspException, IOException
{
out.print(" Done.");
System.out.println("doEngTag() in GetParentTag ");
return SKIP_PAGE;
}
}
---
Why doEngTag() are NOT invoked ?
Thanks in advance!!!