[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


My understanding regarding custom tags

Posted on 2011-10-24
Medium Priority
Last Modified: 2012-05-12
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?
Question by:PrakashVarma
  • 3
LVL 20

Expert Comment

by:chaitu chaitu
ID: 37017275
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

check these links that may help you.

LVL 20

Accepted Solution

chaitu chaitu earned 2000 total points
ID: 37017284
BodyTagSupport allows manipulating the content of evaluating tag body. If you use TagSupport, evaluated body is placed to the page, and the user can do nothing with this. When using BodyTagSupport, the user can pick evaluated body from the buffer (BodyContent object) and transform it according his needs.


Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Loops Section Overview
Suggested Courses
Course of the Month18 days, 23 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question