/** * Invokes tag body. */ public static void invokeBody(final JspFragment body) throws JspException { if (body == null) { return; } try { body.invoke(null); } catch (IOException ioex) { throw new JspException("Tag body failed", ioex); } }
/** * Invokes tag body to provided writer. */ public static void invokeBody(final JspFragment body, final Writer writer) throws JspException { if (body == null) { return; } try { body.invoke(writer); } catch (IOException ioex) { throw new JspException("Tag body failed", ioex); } }
@Override public void evaluate(Writer writer) throws IOException { if (jspFragment == null) { return; } try { jspFragment.invoke(writer); } catch (JspException e) { throw new IOException("JspException when evaluating the body", e); } }
public static String getBodyResult(JspFragment jspBody) throws IOException, JspException { if (jspBody == null) { return ""; } StringWriter writer = new StringWriter(); jspBody.invoke(writer); return writer.toString(); }
public static String getBody(JspFragment fragment) throws JspException, IOException { if (fragment == null) return ""; StringWriter body = new StringWriter(); fragment.invoke(body); body.close(); return body.toString().trim(); }
JspFragment body = getJspBody(); StringWriter stringWriter = new StringWriter(); StringBuffer buff = stringWriter.getBuffer(); buff.append("<h1>"); body.invoke(stringWriter); buff.append("</h1>"); out.println(stringWriter);
protected void doBody() throws JspException, IOException { final JspFragment body = getJspBody(); if (body != null) { body.invoke(null); } }
public void doTag() throws JspException, IOException { String formatted = new SimpleDateFormat("long".equals(format)?"EEE 'the' d:MMM:yyyy":"d:MM:yy") .format(new Date()); StringTokenizer tok = new StringTokenizer(formatted,":"); JspContext context = getJspContext(); context.setAttribute("day", tok.nextToken() ); context.setAttribute("month", tok.nextToken() ); context.setAttribute("year", tok.nextToken() ); JspFragment fragment = getJspBody(); fragment.invoke(null); } }
public void render(Writer writer) throws IOException, JspException { if (getJspBody() != null) { getJspBody().invoke(writer); } }
@Override public void doTag() throws JspException, IOException { JspWriter out = getJspContext().getOut(); StringWriter stringWriter = new StringWriter(); getJspBody().invoke(stringWriter); String highlightedValue = doHighlight(stringWriter.toString()); out.print(highlightedValue); }
public void doTag() throws JspException, IOException { if (JspSupport.hasErrors((PageContext) getJspContext())) { return; } JspFragment f = getJspBody(); if (f != null) { f.invoke(null); } }
public void doTag() throws JspException, IOException { if (!JspSupport.hasErrors((PageContext) getJspContext())) { return; } JspFragment f = getJspBody(); if (f != null) { f.invoke(null); } }
public void doTag() throws JspException, IOException { if (JspSupport.hasError((PageContext) getJspContext(), name)) { return; } JspFragment f = getJspBody(); if (f != null) { f.invoke(null); } }
@Override public void doTag() throws JspException, IOException { Resource resource = Util.getResource(getJspContext()); if (href == null) { Writer buffer = new StringWriter(); getJspBody().invoke(buffer); resource.addCSSEmbed(buffer.toString(), prefix, affix); } else { resource.addCSS(href, prefix, affix); } } }
@Override public void doTag() throws JspException, IOException { JspWriter out = getJspContext().getOut(); StringWriter stringWriter = new StringWriter(); getJspBody().invoke(stringWriter); String highlightedValue = doHighlight(stringWriter.toString()); out.print(highlightedValue); }
@Override public void doTag() throws JspException, IOException { StringWriter ignoredWriter = new StringWriter(); getJspBody().invoke(ignoredWriter); // ignore body text PageContext pageContext = (PageContext) getJspContext(); try { pageContext.forward(getRefinedName()); } catch (ServletException e) { throw new RuntimeException(e.getMessage(), e); } }
@Override public void doTag() throws JspException, IOException { Resource resource = Util.getResource(getJspContext()); if (src == null) { Writer buffer = new StringWriter(); getJspBody().invoke(buffer); resource.addJSEmbed(buffer.toString(), prefix, affix); } else { resource.addJS(src, prefix, affix); } } }
@Override public void doTag() throws JspException, IOException { if (EqualsUtils.objectsEqual(getVal(), getExp())) { getJspBody().invoke(null); } }
@Override public void doTag() throws JspException, IOException { S2Container container = S2ContainerServlet.getContainer(); DataManager manager = (DataManager) container .getComponent(DataManager.class); List list = (List) manager.retrieve(new Path("/" + name + "/"), null); for (Object obj : list) { getJspContext().setAttribute("bean", obj); getJspBody().invoke(getJspContext().getOut()); } } }