KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openi > web > RendererTag


1 /*********************************************************************************
2  * The contents of this file are subject to the OpenI Public License Version 1.0
3  * ("License"); You may not use this file except in compliance with the
4  * License. You may obtain a copy of the License at
5  * http://www.openi.org/docs/LICENSE.txt
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is: OpenI Open Source
12  *
13  * The Initial Developer of the Original Code is Loyalty Matrix, Inc.
14  * Portions created by Loyalty Matrix, Inc. are
15  * Copyright (C) 2005 Loyalty Matrix, Inc.; All Rights Reserved.
16  *
17  * Contributor(s): ______________________________________.
18  *
19  ********************************************************************************/

20 package org.openi.web;
21
22 import org.apache.log4j.Logger;
23 import javax.servlet.jsp.JspException JavaDoc;
24
25
26 /**
27  * @author Uddhab Pant <br>
28  *
29  * Error page (specified by <%@ page errorPage="error.jsp" %> tag) rendering problem
30  * occurs if wcf render tag throws exception. Response output stream is already
31  * flushsed out before the error page is included when exception is thrown. Because of
32  * this reason, error page is not rendered properly. One way to solve this
33  * problem is to put 'render' tag inside try catch block in jsp page.
34  * Other way to solve this problem is to extend com.tonbeller.wcf.component.RendererTag
35  * and redirect to error page when exception is thrown. This requires javascript to
36  * redirect because response output stream is already flushed out and response.sendRedirect()
37  * doesn't work.
38  *
39  */

40 public class RendererTag extends com.tonbeller.wcf.component.RendererTag {
41     private static Logger logger = Logger.getLogger(RendererTag.class);
42
43     /**
44      * renders the component
45      */

46     public int doEndTag() throws JspException JavaDoc {
47         int retVal;
48
49         try {
50             retVal = super.doEndTag();
51         } catch (Exception JavaDoc e) {
52             throw new JspException JavaDoc(e);
53         }
54
55         return retVal;
56     }
57 }
58
Popular Tags