KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > components > ClosingUIBean


1 package com.opensymphony.webwork.components;
2
3 import com.opensymphony.xwork.util.OgnlValueStack;
4 import org.apache.commons.logging.Log;
5 import org.apache.commons.logging.LogFactory;
6
7 import javax.servlet.http.HttpServletRequest JavaDoc;
8 import javax.servlet.http.HttpServletResponse JavaDoc;
9 import java.io.Writer JavaDoc;
10
11 /**
12  * User: plightbo
13  * Date: Jul 18, 2005
14  * Time: 7:55:59 PM
15  */

16 public abstract class ClosingUIBean extends UIBean {
17     private static final Log LOG = LogFactory.getLog(ClosingUIBean.class);
18
19     protected ClosingUIBean(OgnlValueStack stack, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
20         super(stack, request, response);
21     }
22
23     String JavaDoc openTemplate;
24
25     public abstract String JavaDoc getDefaultOpenTemplate();
26
27     public void setOpenTemplate(String JavaDoc openTemplate) {
28         this.openTemplate = openTemplate;
29     }
30
31     public void start(Writer JavaDoc writer) {
32         super.start(writer);
33         try {
34             evaluateParams();
35
36             mergeTemplate(writer, buildTemplateName(openTemplate, getDefaultOpenTemplate()));
37         } catch (Exception JavaDoc e) {
38             LOG.error("Could not open template", e);
39             e.printStackTrace();
40         }
41     }
42 }
43
Popular Tags