KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > abc > NewTagHandler


1 /*
2  * NewTagHandler.java
3  *
4  * Created on February 19, 2005, 12:42 PM
5  */

6
7 package abc;
8
9 import javax.servlet.jsp.tagext.*;
10 import javax.servlet.jsp.JspWriter JavaDoc;
11 import javax.servlet.jsp.JspException JavaDoc;
12
13 /**
14  *
15  * @author mg116726
16  * @version
17  */

18
19 public class NewTagHandler extends SimpleTagSupport {
20
21     /**
22      * Initialization of attr property.
23      */

24     private java.lang.String JavaDoc attr;
25     
26     /**Called by the container to invoke this tag.
27      * The implementation of this method is provided by the tag library developer,
28      * and handles all tag processing, body iteration, etc.
29      */

30     public void doTag() throws JspException JavaDoc {
31         
32         JspWriter JavaDoc out=getJspContext().getOut();
33         
34         try {
35             // TODO: insert code to write html before writing the body content.
36
// e.g.:
37
//
38
// out.println("<strong>" + attribute_1 + "</strong>");
39
// out.println(" <blockquote>");
40

41             JspFragment f=getJspBody();
42             if (f != null) f.invoke(out);
43             
44             // TODO: insert code to write html after writing the body content.
45
// e.g.:
46
//
47
// out.println(" </blockquote>");
48

49         } catch (java.io.IOException JavaDoc ex) {
50             throw new JspException JavaDoc(ex.getMessage());
51         }
52         
53     }
54
55     /**
56      * Setter for the attr attribute.
57      */

58     public void setAttr(java.lang.String JavaDoc value) {
59         this.attr = value;
60     }
61 }
62
Popular Tags