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

📄 hellotag.java

📁 tomcat与java web 这本书的配套源代码
💻 JAVA
字号:
package mypack;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.TagSupport;

public class HelloTag extends TagSupport
{
    public  HelloTag() {

    }

    // Method called when the closing hello tag is encountered
    public int doEndTag() throws JspException {

        try {

            // We use the pageContext to get a Writer
            // We then print the text string Hello
            pageContext.getOut().print("Hello");
        }
        catch (Exception e) {

            throw new JspTagException(e.getMessage());
        }
        // We want to return SKIP_BODY because this Tag does not support
        // a Tag Body
        return SKIP_BODY;
    }

    public void release() {

        // Call the parent's release to release any resources
        // used by the parent tag.
        // This is just good practice for when you start creating
        // hierarchies of tags.
        super.release();
    }
}

⌨️ 快捷键说明

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