KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > module > sitemesh > taglib > decorator > UsePageTag


1 /*
2  * Title: UsePageTag
3  * Description:
4  *
5  * This software is published under the terms of the OpenSymphony Software
6  * License version 1.1, of which a copy has been included with this
7  * distribution in the LICENSE.txt file.
8  */

9
10 package com.opensymphony.module.sitemesh.taglib.decorator;
11
12 import com.opensymphony.module.sitemesh.taglib.AbstractTag;
13
14 import javax.servlet.jsp.JspException JavaDoc;
15 import javax.servlet.jsp.PageContext JavaDoc;
16
17 /**
18  * Expose the Page as a bean to the page which can then be accessed
19  * from scriptlets.
20  *
21  * <p>Depending on the TEI used, the object will be
22  * {@link com.opensymphony.module.sitemesh.Page} or
23  * {@link com.opensymphony.module.sitemesh.HTMLPage}.</p>
24  *
25  * @author <a HREF="joe@truemesh.com">Joe Walnes</a>
26  * @version $Revision: 1.1 $
27  *
28  * @see UsePageTEI
29  * @see UseHTMLPageTEI
30  */

31 public class UsePageTag extends AbstractTag {
32     private String JavaDoc id = null;
33
34     /** Set name of variable the Page will be set as. */
35     public void setId(String JavaDoc id) {
36         this.id = id;
37     }
38
39     public final int doEndTag() throws JspException JavaDoc {
40         pageContext.setAttribute(id, getPage(), PageContext.PAGE_SCOPE);
41         return EVAL_PAGE;
42     }
43 }
Popular Tags