⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tagreplacerule.java

📁 OS(OpenSymphony)的SiteMesh是一个用来在JSP中实现页面布局和装饰(layout and decoration)的框架组件
💻 JAVA
字号:
package com.opensymphony.module.sitemesh.html.rules;import com.opensymphony.module.sitemesh.html.BasicRule;import com.opensymphony.module.sitemesh.html.Tag;import com.opensymphony.module.sitemesh.html.CustomTag;/** * Very simple rule for replacing all occurences of one tag with another. * * <p>For example, to convert all &lt;b&gt; tags to &lt;strong&gt;:</p> * <p>html.addRule(new TagReplaceRule("b", "strong"));</p> * * @author Joe Walnes */public class TagReplaceRule extends BasicRule {    private final String newTagName;    public TagReplaceRule(String originalTagName, String newTagName) {        super(originalTagName);        this.newTagName = newTagName;    }    public void process(Tag tag) {        CustomTag customTag = new CustomTag(tag);        customTag.setName(newTagName);        customTag.writeTo(currentBuffer());    }}

⌨️ 快捷键说明

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