1. 程式人生 > >JSP:自定義標籤的詳細說明

JSP:自定義標籤的詳細說明

//修改標籤內容

public class SimpleDemo3 extends SimpleTagSupport {

         @Override

         public void doTag() throws JspException, IOException {

                   JspFragment jf=this.getJspBody();

                   StringWriter sw=new StringWriter();     

                   jf.invoke(sw);

                   String content=sw.toString();

                   content=content.toUpperCase();  

                   this.getJspContext().getOut().write(content);                

         }

}