标签:style blog http java color os io art
1 package cn.itcast.web.tag; 2 3 import java.io.IOException; 4 import java.io.StringWriter; 5 6 import javax.servlet.jsp.JspException; 7 import javax.servlet.jsp.tagext.JspFragment; 8 import javax.servlet.jsp.tagext.SimpleTagSupport; 9 10 //控制标签体内容为大写 11 public class SimpleTagDemo1 extends SimpleTagSupport { 12 13 14 15 @Override 16 public void doTag() throws JspException, IOException { 17 JspFragment jf = this.getJspBody(); 18 StringWriter sw = new StringWriter(); 19 jf.invoke(sw); 20 21 String content = sw.toString(); 22 content = content.toUpperCase(); 23 24 this.getJspContext().getOut().write(content); 25 } 26 27 28 29 }
标签:style blog http java color os io art
原文地址:http://www.cnblogs.com/aineko/p/3876780.html