1 5 package com.opensymphony.webwork.views.jsp; 6 7 import com.opensymphony.xwork.util.OgnlValueStack; 8 import org.apache.commons.logging.Log; 9 import org.apache.commons.logging.LogFactory; 10 11 import javax.servlet.jsp.JspException ; 12 13 14 18 public class PushTag extends WebWorkBodyTagSupport { 19 21 private static final Log log = LogFactory.getLog(PushTag.class); 22 23 25 private String value; 26 private boolean pushed = false; 27 28 30 public void setValue(String value) { 31 this.value = value; 32 } 33 34 public int doEndTag() throws JspException { 35 OgnlValueStack stack = getStack(); 36 37 if (pushed && (stack != null)) { 38 stack.pop(); 39 } 40 41 return SKIP_BODY; 42 } 43 44 public int doStartTag() throws JspException { 45 OgnlValueStack stack = getStack(); 46 47 if (stack != null) { 48 stack.push(findValue(value)); 49 pushed = true; 50 } else { 51 pushed = false; } 53 54 return EVAL_BODY_INCLUDE; 55 } 56 } 57 | Popular Tags |