/** Process the tag. */
  public int doEndTag() throws JspException {
    Object[] args = null;

    if (_params != null) {
      args = _params.toArray(new Object[_params.size()]);
      _params = null;
    }

    try {
      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
      ELContext env = pageContext.getELContext();

      JspWriter out = pageContext.getOut();

      String key;

      if (_keyExpr != null) key = _keyExpr.evalString(env);
      else key = getBodyContent().getString().trim();

      String msg;

      if (_bundleExpr != null) {
        Object bundleObject = _bundleExpr.evalObject(env);

        msg = pageContext.getLocalizedMessage(bundleObject, key, args, null);
      } else {
        LocalizationContext lc;
        lc = (LocalizationContext) pageContext.getAttribute("caucho.bundle");

        if (lc == null) msg = pageContext.getLocalizedMessage(key, args, null);
        else msg = pageContext.getLocalizedMessage(lc, key, args, null);
      }

      if (_var != null) CoreSetTag.setValue(pageContext, _var, _scope, msg);
      else out.print(msg);
    } catch (Exception e) {
      throw new JspException(e);
    }

    return EVAL_PAGE;
  }