Java Tutorial/JSP/Custom Tag PageAttribute
Set PageContext Attribute in Custom Tag
MyTag.java
package taglib;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.IOException;
public class MyTag extends TagSupport
{
public int doStartTag() {
pageContext.setAttribute("names", "ValueInPageContext");
return SKIP_BODY;
}
}