I just have started in studying JSP Tag Libraries. I write a tag lib just return static content's body of tag to user. I tried to write as below: package com.tagLibs; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; public class readBodyOfTag extends BodyTagSupport { public int doAfterBody() throws JspException { return EVAL_BODY_INCLUDE; } } But it could not run, compiling is OK. It didn't show any error. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ When I tried as below: package com.tagLibs; import java.io.StringWriter; import java.io.PrintWriter; import java.io.IOException; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; public class readBodyOfTag extends BodyTagSupport { public int doAfterBody() throws JspException { try { BodyContent body = getBodyContent(); JspWriter writer = body.getEnclosingWriter(); String bodyString = body.getString(); if (bodyString != null) { writer.println(bodyString); } } catch (IOException ioe) { throw new JspTagException("Error: IOException while writing to the user!"); } return SKIP_BODY; } } It works well. But I don't know why I must write a lot of code just for return static content's body of tag to user. Can anybody tell me why the first code can not run? Thx a lot!