1 package org.jahia.deprecated.taglibs.field.file; 2 3 import java.io.IOException ; 4 5 import javax.servlet.ServletRequest ; 6 import javax.servlet.jsp.JspException ; 7 import javax.servlet.jsp.JspTagException ; 8 import javax.servlet.jsp.JspWriter ; 9 import javax.servlet.jsp.tagext.TagSupport ; 10 11 import org.jahia.data.files.JahiaFileField; 12 import org.jahia.utils.JahiaConsole; 13 14 15 16 26 public abstract class FileFieldAbstract extends TagSupport { 27 28 protected JahiaFileField theFile = null; 29 30 public int doStartTag() throws JspTagException { 31 32 ServletRequest request = pageContext.getRequest(); 33 FileFieldTag fileTag = (FileFieldTag) findAncestorWithClass(this, FileFieldTag.class); 35 if (fileTag == null) { 36 return SKIP_BODY; 37 } 38 theFile = fileTag.getFile(); 40 if (theFile == null) { 41 return SKIP_BODY; 42 } 43 try { 44 JspWriter out = pageContext.getOut(); 45 out.print(getField()); 46 } catch (IOException ioe) { 47 JahiaConsole.println("FileFieldAbstract: doStartTag ",ioe.toString()); 48 } 49 return SKIP_BODY; 50 } 51 52 public abstract String getField(); 54 55 public int doEndTag() throws JspException { 56 theFile = null; 59 return EVAL_PAGE; 60 } 61 62 } 63 64 | Popular Tags |