Java Code Examples for javax.servlet.jsp.tagext.Tag#EVAL_PAGE

The following examples show how to use javax.servlet.jsp.tagext.Tag#EVAL_PAGE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LoggingMessageTagSupport.java    From logging-log4j2 with Apache License 2.0 6 votes vote down vote up
@Override
public final int doEndTag() throws JspException {
    final Log4jTaglibLogger logger = this.getLogger();
    final Level level = this.getLevel();
    final Marker marker = this.getMarker();

    if (TagUtils.isEnabled(logger, level, marker)) {
        final Object message = this.getMessage();
        final Throwable exception = this.getException();
        if (message instanceof Message) {
            logger.logIfEnabled(FQCN, level, marker, (Message) message, exception);
        } else if (message instanceof String) {
            Message data;
            if (this.attributes.size() > 0) {
                data = logger.getMessageFactory().newMessage((String) message, this.attributes.toArray());
            } else {
                data = logger.getMessageFactory().newMessage((String) message);
            }
            logger.logIfEnabled(FQCN, level, marker, data, exception);
        } else {
            logger.logIfEnabled(FQCN, level, marker, logger.getMessageFactory().newMessage(message), exception);
        }
    }

    return Tag.EVAL_PAGE;
}
 
Example 2
Source File: DumpTag.java    From logging-log4j2 with Apache License 2.0 6 votes vote down vote up
@Override
public int doEndTag() throws JspException {
    try {
        final Enumeration<String> names = this.pageContext.getAttributeNamesInScope(this.scope);
        this.pageContext.getOut().write("<dl>");
        while (names != null && names.hasMoreElements()) {
            final String name = names.nextElement();
            final Object value = this.pageContext.getAttribute(name, this.scope);

            this.pageContext.getOut().write("<dt><code>" + name + "</code></dt>");
            this.pageContext.getOut().write("<dd><code>" + value + "</code></dd>");
        }
        this.pageContext.getOut().write("</dl>");
    } catch (final IOException e) {
        throw new JspException("Could not write scope contents. Cause:  " + e.toString(), e);
    }

    return Tag.EVAL_PAGE;
}
 
Example 3
Source File: AccountingLineGroupTag.java    From kfs with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * If our parent isn't AccountingLinesTag, then we should render all the group
 * @see javax.servlet.jsp.tagext.TagSupport#doEndTag()
 */
@Override
public int doEndTag() throws JspException {
    super.doEndTag();
    if (!(getParent() instanceof AccountingLinesTag)) {
        group.renderEverything(pageContext, getParent());
        resetTag();
    }
    return Tag.EVAL_PAGE;
}
 
Example 4
Source File: EntryTag.java    From logging-log4j2 with Apache License 2.0 5 votes vote down vote up
@Override
public int doEndTag() throws JspException {
    final Log4jTaglibLogger logger = this.getLogger();

    if (TagUtils.isEnabled(logger, Level.TRACE, null)) {
        if (this.attributes.size() == 0) {
            logger.entry(FQCN);
        } else {
            logger.entry(FQCN, this.attributes.toArray());
        }
    }

    return Tag.EVAL_PAGE;
}
 
Example 5
Source File: CatchingTag.java    From logging-log4j2 with Apache License 2.0 5 votes vote down vote up
@Override
public int doEndTag() throws JspException {
    final Log4jTaglibLogger logger = this.getLogger();

    if (this.level == null) {
        logger.catching(FQCN, Level.ERROR, this.getException());
    } else {
        logger.catching(FQCN, this.level, this.getException());
    }

    return Tag.EVAL_PAGE;
}
 
Example 6
Source File: ExitTag.java    From logging-log4j2 with Apache License 2.0 5 votes vote down vote up
@Override
public int doEndTag() throws JspException {
    final Log4jTaglibLogger logger = this.getLogger();

    if (TagUtils.isEnabled(logger, Level.TRACE, null)) {
        if (this.result == null) {
            logger.exit(FQCN, null);
        } else {
            logger.exit(FQCN, this.result);
        }
    }

    return Tag.EVAL_PAGE;
}
 
Example 7
Source File: SetLoggerTag.java    From logging-log4j2 with Apache License 2.0 5 votes vote down vote up
@Override
public int doEndTag() throws JspException {
    final Log4jTaglibLogger logger = TagUtils.resolveLogger(this.loggerContext, this.logger, this.factory);

    if (this.var != null) {
        this.pageContext.setAttribute(this.var, logger, this.scope);
    } else {
        TagUtils.setDefaultLogger(this.pageContext, logger);
    }

    return Tag.EVAL_PAGE;
}
 
Example 8
Source File: HelpTag.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
   public int doEndTag() {
return Tag.EVAL_PAGE;
   }
 
Example 9
Source File: CssTag.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
   public int doEndTag() {
return Tag.EVAL_PAGE;
   }
 
Example 10
Source File: WebAppURLTag.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
   public int doEndTag() {
return Tag.EVAL_PAGE;
   }
 
Example 11
Source File: UserTag.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
   public int doEndTag() {
return Tag.EVAL_PAGE;
   }