Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/sitemesh/taglib/decorator/UsePageTag.java


1   package com.sitemesh.taglib.decorator;
2   
3   import javax.servlet.jsp.JspException;
4   import javax.servlet.jsp.PageContext;
5   import com.sitemesh.taglib.AbstractTag;
6   
7   /**
8    * Expose the Page as a bean to the page which can then be accessed
9    * from scriptlets.
10   *
11   * Depending on the TEI used, the object will be Page or HTMLPage.
12   *
13   * @author <a href="joe@truemesh.com">Joe Walnes</a>
14   * @version $Revision: 1.3 $
15   *
16   * @see com.sitemesh.taglib.decorator.UsePageTEI
17   * @see com.sitemesh.taglib.decorator.UseHTMLPageTEI
18   */
19  public class UsePageTag extends AbstractTag {
20  
21    private String id;
22  
23    /**
24     * @label tag extra info 
25     */
26    /*#private UsePageTEI lnkUsePageTEI;*/
27  
28    /**
29     * Set name of variable the Page will be set as.
30     */
31    public void setId( String id ) {
32      this.id = id;
33    }
34  
35    public int doEndTag() throws JspException {
36      pageContext.setAttribute( id, getPage(), PageContext.PAGE_SCOPE );
37      return EVAL_PAGE;
38    }
39  
40  }