1 package org.jahia.deprecated.taglibs.field.page; 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.services.pages.JahiaPage; 12 import org.jahia.utils.JahiaConsole; 13 14 15 25 public abstract class PageFieldAbstract extends TagSupport { 26 27 protected JahiaPage thePage = null; 28 29 public int doStartTag() throws JspTagException { 30 31 ServletRequest request = pageContext.getRequest(); 32 PageFieldTag pageTag = (PageFieldTag) findAncestorWithClass(this, PageFieldTag.class); 34 if (pageTag == null) { 35 return SKIP_BODY; 36 } 37 thePage = pageTag.getPage(); 39 if (thePage == null) { 40 return SKIP_BODY; 41 } 42 try { 43 JspWriter out = pageContext.getOut(); 44 out.print(getField()); 45 } catch (IOException ioe) { 46 JahiaConsole.println("PageFieldAbstract: doStartTag ",ioe.toString()); 47 } 48 return SKIP_BODY; 49 } 50 51 public abstract String getField(); 53 54 public int doEndTag() throws JspException { 55 thePage = null; 58 return EVAL_PAGE; 59 } 60 61 62 } 63 64 | Popular Tags |