1 17 18 19 package jsp2.examples.simpletag; 20 21 import javax.servlet.jsp.JspException ; 22 import javax.servlet.jsp.tagext.SimpleTagSupport ; 23 import java.io.IOException ; 24 import java.util.HashMap ; 25 26 29 public class TileSimpleTag extends SimpleTagSupport { 30 private String color; 31 private String label; 32 33 public void doTag() throws JspException , IOException { 34 getJspContext().getOut().write( 35 "<td width=\"32\" height=\"32\" bgcolor=\"" + this.color + 36 "\"><font color=\"#ffffff\"><center>" + this.label + 37 "</center></font></td>" ); 38 } 39 40 public void setColor( String color ) { 41 this.color = color; 42 } 43 44 public void setLabel( String label ) { 45 this.label = label; 46 } 47 } 48 | Popular Tags |