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