📄 filefieldabstract.java
字号:
package org.jahia.taglibs.field.file;import org.jahia.data.files.JahiaFileField;import org.jahia.exceptions.*;import org.jahia.services.pages.*;import org.jahia.utils.*;import java.io.*;import java.util.*;import javax.servlet.*;import javax.servlet.jsp.*;import javax.servlet.jsp.tagext.*;/** * Class FileFieldAbstractTag : abstract class for the FileField tag * This class will be extended by all the classes which * want to display a JahiaFileField attribute. * It retrieves the current JahiaFileField and call a method * which returns an attribute of this object. * The attribute is defined in each subclass. * * @author Jerome Tamiotti */public abstract class FileFieldAbstract extends TagSupport { protected JahiaFileField theFile = null; public int doStartTag() throws JspTagException { ServletRequest request = pageContext.getRequest(); // retrieves the enclosing FileField tag FileFieldTag fileTag = (FileFieldTag) findAncestorWithClass(this, FileFieldTag.class); if (fileTag == null) { return SKIP_BODY; } // reads the file theFile = fileTag.getFile(); if (theFile == null) { return SKIP_BODY; } try { JspWriter out = pageContext.getOut(); out.print(getField()); } catch (IOException ioe) { JahiaConsole.println("FileFieldAbstract: doStartTag ",ioe.toString()); } return SKIP_BODY; } // will be implemented in the classes mentionned above public abstract String getField();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -