KickJava   Java API By Example, From Geeks To Geeks.

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


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

5 /*
6  * WebWork, Web Application Framework
7  *
8  * Distributable under Apache license.
9  * See terms of license at opensource.org
10  */

11 package com.opensymphony.webwork.views.jsp;
12
13 import com.opensymphony.webwork.components.Include;
14
15 import javax.servlet.http.HttpServletRequest JavaDoc;
16 import javax.servlet.http.HttpServletResponse JavaDoc;
17 import javax.servlet.jsp.JspException JavaDoc;
18
19
20 /**
21  * Include a servlet's output (result of servlet or a JSP page).
22  *
23  * @author Rickard Oberg (rickard@dreambean.com)
24  * @author <a HREF="mailto:scott@atlassian.com">Scott Farquhar</a>
25  * @version $Revision: 1.16 $
26  */

27 public class IncludeTag extends ParametereizedBodyTagSupport {
28     protected Include include;
29     protected String JavaDoc value;
30
31     public int doEndTag() throws JspException JavaDoc {
32         include.addAllParameters(getParameters());
33         include.end(pageContext.getOut());
34
35         return EVAL_PAGE;
36     }
37
38     public int doStartTag() throws JspException JavaDoc {
39         include = new Include(getStack(),
40                 (HttpServletRequest JavaDoc) pageContext.getRequest(),
41                 (HttpServletResponse JavaDoc) pageContext.getResponse());
42         include.setValue(value);
43         include.start(pageContext.getOut());
44
45         return EVAL_BODY_BUFFERED;
46     }
47
48     public void setValue(String JavaDoc value) {
49         this.value = value;
50     }
51 }
52
Popular Tags