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

📄 boxtag.java

📁 用jsp,java写的在线购物系统
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   BoxTag.java

package mediastore.web.tag;

import java.io.IOException;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.TagSupport;

public class BoxTag extends TagSupport
{

    private String id;
    private String title;
    private String width;
    private String height;
    private String align;
    private String valign;

    public BoxTag()
    {
        id = null;
        title = null;
        width = null;
        height = null;
        align = null;
        valign = null;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public void setTitle(String title)
    {
        this.title = title;
    }

    public void setWidth(String width)
    {
        this.width = width;
    }

    public void setHeight(String height)
    {
        this.height = height;
    }

    public void setAlign(String align)
    {
        this.align = align;
    }

    public void setValign(String valign)
    {
        this.valign = valign;
    }

    public int doStartTag()
        throws JspException
    {
        JspWriter jspOut = pageContext.getOut();
        try
        {
            jspOut.print("<table class=box border=0 cellspacing=1");
            if(id != null)
                jspOut.print(" id=\"" + id + "\"");
            if(width != null)
                jspOut.print(" width=" + width);
            if(height != null)
                jspOut.print(" height=" + height);
            jspOut.println(">");
            jspOut.println("  <tr>");
            jspOut.println("    <th class=box width=100%>" + title + "</th>");
            jspOut.println("  </tr>");
            jspOut.println("  <tr>");
            jspOut.print("    <td class=box");
            if(height != null)
                jspOut.print(" height=100%");
            if(align != null)
                jspOut.print(" align=" + align);
            if(valign != null)
                jspOut.print(" valign=" + valign);
            jspOut.println(">");
        }
        catch(IOException e)
        {
            throw new JspException("IOException occurred while writing box-start-tag " + title);
        }
        return 1;
    }

    public int doEndTag()
        throws JspException
    {
        JspWriter jspOut = pageContext.getOut();
        try
        {
            jspOut.println("    </td>");
            jspOut.println("  </tr>");
            jspOut.println("</table>");
        }
        catch(IOException e)
        {
            throw new JspException("IOException occurred while writing box-start-tag " + title);
        }
        id = null;
        title = null;
        width = null;
        height = null;
        align = null;
        valign = null;
        return 6;
    }
}

⌨️ 快捷键说明

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