htmlhelloworldtag.java

来自「tbuy1.1.5是在netbeans环境下用JSF技术编写的一个论坛tbuy1」· Java 代码 · 共 59 行

JAVA
59
字号
/* * HtmlHelloWorldTag.java *  * Created on 2007-9-24, 7:19:26 *  * To change this template, choose Tools | Templates * and open the template in the editor. */package biz.tbuy.common.components.test;import javax.faces.application.Application;import javax.faces.component.UIComponent;import javax.faces.context.FacesContext;import javax.faces.el.ValueBinding;import javax.faces.webapp.UIComponentTag;/** * * @author Administrator */public class HtmlHelloWorldTag extends UIComponentTag{    String msg = null;    public HtmlHelloWorldTag() {    }    public String getComponentType() {        return "HtmlHelloWorld";    }    public String getRendererType() {        return null;    }        @Override    protected void setProperties(UIComponent ui) {        super.setProperties(ui);        if (msg != null) {            if (isValueReference(msg)) {                FacesContext fc = FacesContext.getCurrentInstance();                Application app = fc.getApplication();                ValueBinding vb = app.createValueBinding(msg);                ui.setValueBinding("msg", vb);            } else {                ui.getAttributes().put("msg", msg);            }        }    }        public void setMsg(String msg) {        this.msg = msg;    }        public void release() {        super.release();        msg = null;    }}

⌨️ 快捷键说明

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