1 5 package com.opensymphony.webwork.views.jsp; 6 7 import com.opensymphony.webwork.WebWorkStatics; 8 import com.opensymphony.webwork.components.ActionComponent; 9 10 import javax.servlet.http.HttpServletRequest ; 11 import javax.servlet.http.HttpServletResponse ; 12 import javax.servlet.jsp.JspException ; 13 14 17 public class ActionTag extends ParameterizedTagSupport implements WebWorkStatics { 18 protected ActionComponent component; 19 20 protected String name; 21 protected String namespace; 22 protected boolean executeResult; 23 protected boolean ignoreContextParams; 24 25 public int doEndTag() throws JspException { 26 component.addAllParameters(getParameters()); 27 component.end(pageContext.getOut()); 28 pageContext.setAttribute(getId(), component.getProxy().getAction()); 29 30 return SKIP_BODY; 31 } 32 33 public int doStartTag() throws JspException { 34 component = new ActionComponent(getStack(), 35 (HttpServletRequest ) pageContext.getRequest(), 36 (HttpServletResponse ) pageContext.getResponse()); 37 component.setId(id); 38 component.setName(name); 39 component.setNamespace(namespace); 40 component.setExecuteResult(executeResult); 41 component.setIgnoreContextParams(ignoreContextParams); 42 component.start(pageContext.getOut()); 43 44 return EVAL_BODY_INCLUDE; 45 } 46 47 public void setName(String name) { 48 this.name = name; 49 } 50 51 public void setNamespace(String namespace) { 52 this.namespace = namespace; 53 } 54 55 public void setExecuteResult(boolean executeResult) { 56 this.executeResult = executeResult; 57 } 58 59 public void setIgnoreContextParams(boolean ignoreContextParams) { 60 this.ignoreContextParams = ignoreContextParams; 61 } 62 } 63 | Popular Tags |