Examples of JspWriter


Examples of javax.servlet.jsp.JspWriter

    }
   
    try {
      PageContextImpl pc = (PageContextImpl) pageContext;
     
      JspWriter out = pc.getOut();

      String key = _key;

      if (_key != null) {
        key = _key;
      }
      else if (bodyContent != null) {

        String bodyString = bodyContent.getString();

        if (bodyString != null)
          key = bodyString.trim();
      }

      if (key == null)
        key = "";

      String msg;

      LocalizationContext locCtx;

      if (_bundle instanceof String) {
        locCtx = pc.getBundle((String) _bundle);
      }
      else if (_bundle instanceof LocalizationContext) {
        locCtx = (LocalizationContext) _bundle;
      }
      else if (_bundle == null) {
        locCtx
          = (LocalizationContext) pageContext.getAttribute("caucho.bundle");
      } else {
        locCtx = null;
      }

      if (locCtx == null) {
        msg = pc.getLocalizedMessage(key, args, null);
      }
      else {
        msg = pc.getLocalizedMessage(locCtx, key, args, null);

        Locale locale = locCtx.getLocale();
       
        if (locale != null)
          I18NSupport.setResponseLocale(pageContext, locale);
      }

      if (_var != null)
        CoreSetTag.setValue(pc, _var, _scope, msg);
      else
        out.print(msg);
    } catch (IOException e) {
    }

    return EVAL_PAGE;
  }
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

    throws JspException
  {
    try {
      PageContextImpl pc = (PageContextImpl) pageContext;
     
      JspWriter out = pc.getOut();

      NumberFormat format = getFormat();

      String string;

      if (_value != null)
        string = _value;
      else if (bodyContent != null)
        string = bodyContent.getString().trim();
      else
        string = null;

      Number value = null;

      if (string != null && ! "".equals(string))
        value = format.parse(string);

      if (_var == null) {
        if (_scope != null)
          throw new JspException(L.l("fmt:parseNumber var must not be null when scope '{0}' is set.",
                                     _scope));

        if (value != null)
          out.print(value);
      }
      else
        CoreSetTag.setValue(pageContext, _var, _scope, value);
    } catch (IOException e) {
    } catch (ParseException e) {
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

  public int doStartTag()
    throws JspException
  {
    _query.clear();
   
    JspWriter jspWriter = null;
   
    try {
      if (_varReader != null) {
        jspWriter = pageContext.pushBody();
       
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

    if (_varReader != null) {
      this.pageContext.removeAttribute(_varReader);
    }
    else {
      try {
        JspWriter jspWriter = pageContext.pushBody();
         
        BodyContentImpl body = (BodyContentImpl) pageContext.getOut();

        handleBody(body);
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

      //url = url.substring(0, p) + '?' + _query + '&' + url.substring(p + 1);
    }
    else
      url = url + '?' + _query;

    JspWriter out = body;
    if (out instanceof ResinJspWriter)
      ((ResinJspWriter) out).flushBuffer();
    else {
      // jsp/1ei0
      // out.flush();
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

          in.setEncoding(encoding);
        }
      }
     
      JspWriter out = pageContext.getOut();

      int ch;
      while ((ch = in.readChar()) >= 0)
        out.print((char) ch);
    } finally {
      is.close();
    }
  }
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

    throws JspException
  {
    try {
      PageContextImpl pageContext = (PageContextImpl) this.pageContext;

      JspWriter out = pageContext.getOut();

      Node node = pageContext.getNodeEnv();

      Env env = XPath.createEnv();
      env.setVarEnv(pageContext.getVarEnv());

      String value = _select.evalString(node, env);

      env.free();

      if (_escapeXml)
        com.caucho.el.Expr.toStreamEscaped(out, value);
      else
        out.print(value);
    }
    catch (Exception e) {
      throw new JspException(e);
    }
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

    throws JspException
  {
    try {
      PageContextImpl pc = (PageContextImpl) pageContext;
     
      JspWriter out = pc.getOut();

      String string = null;

      if (_value != null)
        string = _value;
      else if (bodyContent != null) {
        string = bodyContent.getString();
       
        if (string != null)
          string = string.trim();
      }
     
      DateFormat format = getFormat();

      Object value;

      if (string == null || "".equals(string))
        value = null;
      else
        value = format.parse(string);

      if (_var == null) {
        if (_scope != null)
          throw new JspException(L.l("fmt:parseDate var must not be null when scope '{0}' is set.",
                                     _scope));

        if (value != null)
          out.print(value);
      }
      else
        CoreSetTag.setValue(pageContext, _var, _scope, value);
    } catch (IOException e) {
    } catch (ParseException e) {
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

    throws JspException
  {
    try {
      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
     
      JspWriter out = pageContext.getOut();

      if (_value != null) {
        if (_escapeXml)
          Expr.toStreamEscaped(out, _value);
        else
          out.print(_value);
      }
      else if (_defaultValue != null) {
        if (_escapeXml)
          Expr.toStreamEscaped(out, _defaultValue);
        else
          out.print(_defaultValue);
      }
      else
        return EVAL_BODY_BUFFERED;
    } catch (IOException e) {
    }
View Full Code Here

Examples of javax.servlet.jsp.JspWriter

  public int doEndTag() throws JspException
  {
    try {
      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
     
      JspWriter out = pageContext.getOut();
     
      BodyContentImpl body = (BodyContentImpl) getBodyContent();

      if (body != null) {
        String s = body.getString().trim();

        if (_escapeXml)
          Expr.toStreamEscaped(out, s);
        else
          out.print(s);
      }
    } catch (Exception e) {
    }

    return EVAL_PAGE;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.