1 19 20 25 26 package test; 27 28 import javax.servlet.jsp.tagext.*; 29 import javax.servlet.jsp.JspWriter ; 30 import javax.servlet.jsp.JspException ; 31 32 37 38 public class EchoTagHandler extends SimpleTagSupport { 39 40 43 private java.lang.String message; 44 45 49 public void doTag() throws JspException { 50 51 JspWriter out=getJspContext().getOut(); 52 53 try { 54 out.println("<b>Echo: " + message + "</b>"); 55 JspFragment f=getJspBody(); 56 if (f != null) f.invoke(out); 57 } catch (java.io.IOException ex) { 58 throw new JspException (ex.getMessage()); 59 } 60 61 } 62 63 66 public void setMessage(java.lang.String value) { 67 this.message = value; 68 } 69 } 70 | Popular Tags |