usepagetag.java

来自「OS(OpenSymphony)的SiteMesh是一个用来在JSP中实现页面布」· Java 代码 · 共 43 行

JAVA
43
字号
/* * Title:        UsePageTag * Description: * * This software is published under the terms of the OpenSymphony Software * License version 1.1, of which a copy has been included with this * distribution in the LICENSE.txt file. */package com.opensymphony.module.sitemesh.taglib.decorator;import com.opensymphony.module.sitemesh.taglib.AbstractTag;import javax.servlet.jsp.JspException;import javax.servlet.jsp.PageContext;/** * Expose the Page as a bean to the page which can then be accessed * from scriptlets. * * <p>Depending on the TEI used, the object will be * {@link com.opensymphony.module.sitemesh.Page} or * {@link com.opensymphony.module.sitemesh.HTMLPage}.</p> * * @author <a href="joe@truemesh.com">Joe Walnes</a> * @version $Revision: 1.1 $ * * @see UsePageTEI * @see UseHTMLPageTEI */public class UsePageTag extends AbstractTag {    private String id = null;    /** Set name of variable the Page will be set as. */    public void setId(String id) {        this.id = id;    }    public final int doEndTag() throws JspException {        pageContext.setAttribute(id, getPage(), PageContext.PAGE_SCOPE);        return EVAL_PAGE;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?