📄 pagefieldabstract.java
字号:
package org.jahia.taglibs.field.page;import org.jahia.exceptions.JahiaException;import org.jahia.services.pages.JahiaPage;import org.jahia.utils.JahiaConsole;import java.io.*;import java.util.*;import javax.servlet.*;import javax.servlet.jsp.*;import javax.servlet.jsp.tagext.*;/** * Class PageFieldAbstract : abstract class for the PageField tag * * This class will be extended by all the classes which want to display * a JahiaPageField attribute. It retrieves the current JahiaPageField * and call a method which returns an attribute of this object. * This attribute is defined in each subclass. * * @author Jerome Tamiotti */public abstract class PageFieldAbstract extends TagSupport { protected JahiaPage thePage = null; public int doStartTag() throws JspTagException { ServletRequest request = pageContext.getRequest(); // retrieves the enclosing PageField tag PageFieldTag pageTag = (PageFieldTag) findAncestorWithClass(this, PageFieldTag.class); if (pageTag == null) { return SKIP_BODY; } // reads the page thePage = pageTag.getPage(); if (thePage == null) { return SKIP_BODY; } try { JspWriter out = pageContext.getOut(); out.print(getField()); } catch (IOException ioe) { JahiaConsole.println("PageFieldAbstract: 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 + -