Link to home
Start Free TrialLog in
Avatar of PrakashVarma
PrakashVarma

asked on

My understanding regarding custom tags

Hi Friends,
The doAfterBody method(in TagSupport class) is called after the body content is evaluated it means for the first time body content is evaluated by doStartTag method after that it is evaluated by doAfterBody method,right?and what is the difference between doAfterBody method in TagSupport class and BodyTagSupport class?
Avatar of chaitu chaitu
chaitu chaitu
Flag of India image

The doAfterBody() method is invoked after the first evaluation of the body content (if it is not empty). By returning SKIP_BODY, the doAfterBody() method can tell the JSP container that the processing of the body content is finished:

public int doAfterBody() throws JspException {
// do something, or nothing
return SKIP_BODY;
}Sometimes the tag handler class must continually process the body content of a custom tag in a loop. You can tell the JSP container to repeatedly evaluate the body content and doAfterBody() invocation by returning EVAL_BODY_TAG from doAfterBody(). Note that because processing can change the body content or its context, each body content evaluation can have differing results.

public int doAfterBody() throws JspException {
//do something, or nothing
return EVAL_BODY_TAG;
}


check these links that may help you.

http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags6.html
http://java.boot.by/wcd-guide/ch10.html
http://www.examulator.com/moodle/mod/resource/view.php?id=470
ASKER CERTIFIED SOLUTION
Avatar of chaitu chaitu
chaitu chaitu
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial