paramtag.java
来自「OS(OpenSymphony)的SiteMesh是一个用来在JSP中实现页面布」· Java 代码 · 共 36 行
JAVA
36 行
/* * Title: ParamTag * 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.page;import javax.servlet.jsp.tagext.BodyTagSupport;import javax.servlet.jsp.tagext.Tag;/** * Add a parameter to the inline Decorator, as if specified in the Page. * * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a> * @version $Revision: 1.2 $ */public class ParamTag extends BodyTagSupport { private String name; public void setName(String name) { this.name = name; } public int doAfterBody() { Tag parent = findAncestorWithClass(this, ApplyDecoratorTag.class); if (parent instanceof ApplyDecoratorTag) { ApplyDecoratorTag t = (ApplyDecoratorTag)parent; t.addParam(name, getBodyContent().getString()); } return SKIP_BODY; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?