/** * Read the unescaped body content from the page. * @return the original content * @throws IOException if reading failed */ protected String readBodyContent() throws IOException { Assert.state(this.bodyContent != null, "No BodyContent set"); return this.bodyContent.getString(); }
/** * Read the unescaped body content from the page. * @return the original content * @throws IOException if reading failed */ protected String readBodyContent() throws IOException { Assert.state(this.bodyContent != null, "No BodyContent set"); return this.bodyContent.getString(); }
@Override protected void renderFromBodyContent(BodyContent bodyContent, TagWriter tagWriter) throws JspException { Object value = this.pageContext.getAttribute(VALUE_VARIABLE_NAME); String label = bodyContent.getString(); renderOption(value, label, tagWriter); }
/** * If {@link #shouldRender rendering}, flush any buffered * {@link BodyContent} or, if no {@link BodyContent} is supplied, * {@link #renderDefaultContent render the default content}. * @return a {@link javax.servlet.jsp.tagext.Tag#EVAL_PAGE} result */ @Override public int doEndTag() throws JspException { if (shouldRender()) { Assert.state(this.tagWriter != null, "No TagWriter set"); if (this.bodyContent != null && StringUtils.hasText(this.bodyContent.getString())) { renderFromBodyContent(this.bodyContent, this.tagWriter); } else { renderDefaultContent(this.tagWriter); } } return EVAL_PAGE; }
@Override public int doEndTag() throws JspException { Object argument = null; if (this.valueSet) { argument = this.value; } else if (getBodyContent() != null) { // Get the value from the tag body argument = getBodyContent().getString().trim(); } // Find a param-aware ancestor ArgumentAware argumentAwareTag = (ArgumentAware) findAncestorWithClass(this, ArgumentAware.class); if (argumentAwareTag == null) { throw new JspException("The argument tag must be a descendant of a tag that supports arguments"); } argumentAwareTag.addArgument(argument); return EVAL_PAGE; }
@Override protected void renderFromBodyContent(BodyContent bodyContent, TagWriter tagWriter) throws JspException { Object value = this.pageContext.getAttribute(VALUE_VARIABLE_NAME); String label = bodyContent.getString(); renderOption(value, label, tagWriter); }
/** * Sets the 'body' property to be equal to the body content of this tag. Calls the * {@link SidebarTag#setSubSidebar(SubSidebarTag)} method of the parent tag. * @return {@link #EVAL_PAGE} * @throws JspException if an error occurs. */ @Override public int doEndTag() throws JspException { setBody(bodyContent.getString()); parent.setSubSidebar(this); return EVAL_PAGE; } }
/** * If {@link #shouldRender rendering}, flush any buffered * {@link BodyContent} or, if no {@link BodyContent} is supplied, * {@link #renderDefaultContent render the default content}. * @return a {@link javax.servlet.jsp.tagext.Tag#EVAL_PAGE} result */ @Override public int doEndTag() throws JspException { if (shouldRender()) { Assert.state(this.tagWriter != null, "No TagWriter set"); if (this.bodyContent != null && StringUtils.hasText(this.bodyContent.getString())) { renderFromBodyContent(this.bodyContent, this.tagWriter); } else { renderDefaultContent(this.tagWriter); } } return EVAL_PAGE; }
@Override public int doEndTag() throws JspException { Object argument = null; if (this.valueSet) { argument = this.value; } else if (getBodyContent() != null) { // Get the value from the tag body argument = getBodyContent().getString().trim(); } // Find a param-aware ancestor ArgumentAware argumentAwareTag = (ArgumentAware) findAncestorWithClass(this, ArgumentAware.class); if (argumentAwareTag == null) { throw new JspException("The argument tag must be a descendant of a tag that supports arguments"); } argumentAwareTag.addArgument(argument); return EVAL_PAGE; }
@Override public int doEndTag() throws JspException { Param param = new Param(); param.setName(this.name); if (this.valueSet) { param.setValue(this.value); } else if (getBodyContent() != null) { // Get the value from the tag body param.setValue(getBodyContent().getString().trim()); } // Find a param aware ancestor ParamAware paramAwareTag = (ParamAware) findAncestorWithClass(this, ParamAware.class); if (paramAwareTag == null) { throw new JspException("The param tag must be a descendant of a tag that supports parameters"); } paramAwareTag.addParam(param); return EVAL_PAGE; }
/** * Performs smart form population. */ @Override public int doAfterBody() throws JspException { BodyContent body = getBodyContent(); JspWriter out = body.getEnclosingWriter(); String bodytext = populateForm(body.getString(), name -> value(name, pageContext)); try { out.print(bodytext); } catch (IOException ioex) { throw new JspException(ioex); } return SKIP_BODY; }
String body = getBodyContent().getString();
@Override public int doEndTag() throws JspException { Param param = new Param(); param.setName(this.name); if (this.valueSet) { param.setValue(this.value); } else if (getBodyContent() != null) { // Get the value from the tag body param.setValue(getBodyContent().getString().trim()); } // Find a param aware ancestor ParamAware paramAwareTag = (ParamAware) findAncestorWithClass(this, ParamAware.class); if (paramAwareTag == null) { throw new JspException("The param tag must be a descendant of a tag that supports parameters"); } paramAwareTag.addParam(param); return EVAL_PAGE; }
if (getBodyContent().getString() == null) { throw new JspException("Error, no template (body value) set for the sidebar tag."); String subitemURL = firstSubItem.attributeValue("url"); String subitemDescr = item.attributeValue("description"); String value = getBodyContent().getString(); if (value != null) { value = StringUtils.replace(value, "[id]", clean(subitemID));
if (getBodyContent().getString() == null) { throw new JspException("Error, no template (body value) set for the sidebar tag."); String subitemDescr = item.attributeValue("description"); pluginName = item.attributeValue("plugin"); String value = getBodyContent().getString(); if (value != null) { value = StringUtils.replace(value, "[id]", clean(subitemID));
@Override public int doAfterBody() throws JspException { try (BodyContent bc = getBodyContent()) { String body = bc.getString().trim(); String buf = calculateSuffix(body); bc.getEnclosingWriter().print(buf); } catch (IOException e) { logger.trace("", e); throw new JspException("Error:IOException while writing to client" + e.getMessage()); } return SKIP_BODY; }
@Override public int doAfterBody() throws JspException { print(getBodyContent().getString().trim(), getBodyContent().getEnclosingWriter()); return SKIP_BODY; }
public int doAfterBody() throws JspException { try { ApplResources ar = ApplResources.getInstance(pageContext.getServletContext()); ResultCache rc = ResultCache.getInstance( pageContext.getSession(), pageContext.getServletContext(), name); // if this is the first call, we have to parse the mdx query if (!resultCache || rc.getQuery() == null) { String mdx = getBodyContent().getString(); rc.parse(mdx); } return SKIP_BODY; } catch (Exception e) { e.printStackTrace(); throw new JspException(e); } }
public int doEndTag() throws JspException { try { pageContext.getOut().print(bodyContent.getString()); } catch (IOException ioe) { throw new JspTagException(ioe.toString(), ioe); } return EVAL_PAGE; }
public int doEndTag() throws JspException { if (bodyContent != null) { try { pageContext.getOut().print(bodyContent.getString()); } catch (IOException ioe) { throw new JspTagException(ioe.toString(), ioe); } } return EVAL_PAGE; }