KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > exceptions > web > LoggerFormatterTagHandler


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.exceptions.web;
20
21 import java.io.IOException JavaDoc;
22 import java.io.Serializable JavaDoc;
23 import javax.servlet.jsp.tagext.*;
24 import javax.servlet.jsp.JspWriter JavaDoc;
25 import javax.servlet.jsp.JspException JavaDoc;
26
27 /**
28  *
29  * @author Jan Horvath
30  * @version
31  */

32
33 public class LoggerFormatterTagHandler extends SimpleTagSupport {
34     
35     /**Called by the container to invoke this tag.
36      * The implementation of this method is provided by the tag library developer,
37      * and handles all tag processing, body iteration, etc.
38      */

39     private byte[] data;
40     
41     /**Called by the container to invoke this tag.
42      * The implementation of this method is provided by the tag library developer,
43      * and handles all tag processing, body iteration, etc.
44      */

45     public void doTag() throws JspException JavaDoc {
46         
47         JspWriter JavaDoc out=getJspContext().getOut();
48         
49         try {
50
51             JspFragment f=getJspBody();
52             if (f != null) f.invoke(out);
53            // out.println(Utils.getHTMLLog(data));
54

55             
56         } catch (IOException JavaDoc ex) {
57             java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE,
58                     ex.getMessage(), ex);
59             throw new JspException JavaDoc(ex.getMessage());
60         }
61         
62     }
63     
64     public void setData(byte[] data) {
65         this.data = data;
66     }
67 }
68
Popular Tags