List of usage examples for javax.servlet.jsp.tagext Tag doEndTag
int doEndTag() throws JspException;
From source file:de.micromata.genome.gwiki.page.gspt.TagSupport.java
/** * @return true if continue//from w w w .ja v a 2s .c o m */ public static boolean endTag(ChildPageContext ctx) throws Exception { Pair<Tag, Integer> tt = ctx.getTagStack().pop(); Tag t = tt.getFirst(); int r = t.doEndTag(); if (ctx.getTagStack().size() > 0) ctx.setCurrentTag(ctx.getTagStack().lastElement().getFirst()); else ctx.setCurrentTag(null); boolean ret = r != javax.servlet.jsp.tagext.Tag.SKIP_PAGE; if (log.isDebugEnabled() == true) log.debug("endTag: " + t.getClass().getName() + ": " + ret); return ret; }
From source file:de.micromata.genome.gwiki.page.gspt.TagSupport.java
/** * @return if return false page will be skipped *//*from w w w. j a v a 2s .com*/ public static boolean initSimpleTag(Tag tag, List<Object> attributes, ChildPageContext ctx) throws Exception { if (log.isDebugEnabled()) log.debug("Init simple tag: " + tag.getClass().getName()); Tag ptag = ctx.getCurrentTag(); PageContext pctx = ctx;// .getBrickContext().getPageContext(); if (ctx.isUseParentTagContext() == true) pctx = ctx.getParentPageContext(); tag.setPageContext(pctx); tag.setParent(ptag); attributes = evalAttributes(tag, attributes, ctx); setAttributes(tag, attributes, ctx); ctx.setCurrentTag(tag); int r = tag.doStartTag(); // ctx.getTagStack().push(new Pair<Tag, Integer>(tag, r)); r = tag.doEndTag(); // ctx.getTagStack().pop(); ctx.setCurrentTag(ptag); return r != javax.servlet.jsp.tagext.Tag.SKIP_PAGE; }
From source file:de.micromata.genome.gwiki.page.impl.wiki.macros.GWikiJspTagMacro.java
@Override public boolean render(MacroAttributes attrs, GWikiContext ctx) { try {/*from www. j a va 2 s .c o m*/ PageContext pageContext = ctx.getCreatePageContext(); ChildPageContext childPageContext = null; if (pageContext instanceof ChildPageContext) { childPageContext = (ChildPageContext) pageContext; } else { childPageContext = new GspPageContext(pageContext); } boolean includeBody = initTag(attrs, ctx, childPageContext); if ((tag instanceof BodyTag) == false) { if (tag instanceof Tag) { Tag ttag = (Tag) tag; ttag.doEndTag(); } return true; } if (includeBody == true) { while (true) { if (attrs.getChildFragment().render(ctx) == false) { return false; } if (TagSupport.continueAfterBody(childPageContext) == false) { break; } } TagSupport.afterBody(childPageContext); return TagSupport.endTag(childPageContext); } } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException(ex); } return true; }
From source file:com.icesoft.faces.webapp.parser.Parser.java
/** * This member mimicks the JSP tag processing lifecyle across the tag * processing tree to produce the JSF component tree. * * @param wire The tag's wire/* w ww .ja va2 s .co m*/ * @param pageContext The page context * @param facesContext The faces context * @param componentIds * @throws JspException */ public void executeJspLifecycle(TagWire wire, PageContext pageContext, FacesContext facesContext, Set componentIds) throws JspException { // Start of lifecycle; boolean processingViewTag = false; Tag tag = wire.getTag(); tag.setPageContext(pageContext); // Start tag processing; tag.doStartTag(); UIComponent myComponent = null; // reference will be used after doEndTag if (tag instanceof UIComponentTag) { UIComponentTag compTag = (UIComponentTag) tag; myComponent = compTag.getComponentInstance(); if (myComponent != null) { if (myComponent instanceof UIViewRoot) { myComponent.setId("_view"); processingViewTag = true; } String componentId = myComponent.getClientId(facesContext); if (componentIds.contains(componentId)) throw new IllegalStateException("Duplicate component ID : " + componentId); componentIds.add(componentId); } } // Now process tag children; Iterator children = wire.getChildren().iterator(); while (children.hasNext()) { TagWire childWire = (TagWire) children.next(); executeJspLifecycle(childWire, pageContext, facesContext, componentIds); } //Do tag body processing. This is not full-fledged body processing. It only calls the doAfterBody() member if (!processingViewTag && tag instanceof UIComponentBodyTag) { UIComponentBodyTag bodyTag = (UIComponentBodyTag) tag; if (bodyTag.getBodyContent() == null) { //body content of custom tag should not be null, so create one in here to satisfy the //checking in jsf 1.0 impl. JspWriter jspWriter = new JspWriterImpl(new PrintWriter(System.out)); BodyContentImpl imp = new BodyContentImpl(jspWriter); bodyTag.setBodyContent(imp); } bodyTag.doAfterBody(); } // Do end tag processing; tag.doEndTag(); // ICE-3443: to save memory, trim the COMPONENT_IDS list capacity // to its actual size if (null != myComponent) { Map attributes = myComponent.getAttributes(); ArrayList idsList = (ArrayList) attributes.get("javax.faces.webapp.COMPONENT_IDS"); if (null != idsList) { idsList.trimToSize(); } } }
From source file:org.seasar.mayaa.impl.engine.processor.JspProcessor.java
public ProcessStatus doEndProcess() { Tag customTag = getLoadedTag(); try {//from w w w . j ava 2s . c o m int ret = customTag.doEndTag(); return getProcessStatus(ret, true); } catch (JspException e) { throw createJspRuntimeException(getOriginalNode(), getInjectedNode(), e); } finally { if (!canCatch()) { releaseLoadedTag(); popNestedVariables(); } } }