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

📄 fileinputtag.java

📁 GridSphere 门户 提供一个基于 portlet 的高级开放源代码门户。GridSphere 是在欧盟提供基金的 GridLab 项目下开发的
💻 JAVA
字号:
/** @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a>* @version $Id: FileInputTag.java 4666 2006-03-27 17:47:56Z novotny $*/package org.gridsphere.provider.portletui.tags;import org.gridsphere.provider.portletui.beans.FileInputBean;import javax.servlet.jsp.JspException;import javax.servlet.jsp.JspWriter;/** * A <code>FileInputTag</code> represnts a file input element to be used for uploading files */public class FileInputTag extends BaseComponentTag {    protected FileInputBean fileInputBean = null;    protected int size = 0;    protected int maxlength = 0;    /**     * Returns the (html) size of the field     *     * @return size of the field     */    public int getSize() {        return size;    }    /**     * Sets the (html) size of the field     *     * @param size size of the field     */    public void setSize(int size) {        this.size = size;    }    /**     * Returns the (html) maxlength of the field     *     * @return the max length of the field     */    public int getMaxlength() {        return maxlength;    }    /**     * Sets the (html) max length of the field     *     * @param maxlength the max length of the field     */    public void setMaxlength(int maxlength) {        this.maxlength = maxlength;    }    public int doStartTag() throws JspException {        if (!beanId.equals("")) {            fileInputBean = (FileInputBean) getTagBean();            if (fileInputBean == null) {                fileInputBean = new FileInputBean();                fileInputBean.setBeanId(beanId);                this.setBaseComponentBean(fileInputBean);            } else {                this.updateBaseComponentBean(fileInputBean);            }        } else {            fileInputBean = new FileInputBean();            this.setBaseComponentBean(fileInputBean);            if (maxlength != 0) fileInputBean.setMaxLength(maxlength);            if (size != 0) fileInputBean.setSize(size);        }        //debug();        try {            JspWriter out = pageContext.getOut();            out.print(fileInputBean.toStartString());        } catch (Exception e) {            throw new JspException(e.getMessage());        }        return SKIP_BODY;    }}

⌨️ 快捷键说明

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