KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > views > jsp > ActionTag


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

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 JavaDoc;
11 import javax.servlet.http.HttpServletResponse JavaDoc;
12 import javax.servlet.jsp.JspException JavaDoc;
13
14 /**
15  * @see ActionComponent
16  */

17 public class ActionTag extends ParameterizedTagSupport implements WebWorkStatics {
18     protected ActionComponent component;
19
20     protected String JavaDoc name;
21     protected String JavaDoc namespace;
22     protected boolean executeResult;
23     protected boolean ignoreContextParams;
24
25     public int doEndTag() throws JspException JavaDoc {
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 JavaDoc {
34         component = new ActionComponent(getStack(),
35                 (HttpServletRequest JavaDoc) pageContext.getRequest(),
36                 (HttpServletResponse JavaDoc) 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 JavaDoc name) {
48         this.name = name;
49     }
50
51     public void setNamespace(String JavaDoc 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