Package com.caucho.jsp

Examples of com.caucho.jsp.PageContextImpl$PageELContext


  private Source getSource(Expr xmlExpr, Expr systemIdExpr)
    throws JspException
  {
    try {
      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
     
      Object xmlObj = xmlExpr.evalObject(pageContext.getELContext());
      String systemId = null;
      Source source = null;

      if (systemIdExpr != null)
        systemId = systemIdExpr.evalString(pageContext.getELContext());
     
      source = convertToSource(xmlObj, systemId);

      return source;
    } catch (ELException e) {
View Full Code Here


   */
  public int doEndTag()
    throws JspException
  {
    try {
      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
     
      JspWriter out = pageContext.getOut();

      NumberFormat format = getFormat();

      String string;

      if (_valueExpr != null)
        string = _valueExpr.evalString(pageContext.getELContext());
      else
        string = bodyContent.getString().trim();

      Number value = format.parse(string);

View Full Code Here

  }

  protected NumberFormat getFormat()
    throws JspException, ELException
  {
    PageContextImpl pageContext = (PageContextImpl) this.pageContext;
    ELContext env = pageContext.getELContext();
     
    NumberFormat format = null;

    Locale locale = null;

    if (_parseLocaleExpr != null) {
      Object localeObj = _parseLocaleExpr.evalObject(env);

      if (localeObj instanceof Locale)
        locale = (Locale) localeObj;
      else if (localeObj instanceof String)
        locale = pageContext.getLocale((String) localeObj, null);
    }
   
    if (locale == null)
      locale = pageContext.getLocale();

    String type = null;
    if (_typeExpr != null)
      type = _typeExpr.evalString(env);
View Full Code Here

    throws JspException
  {
    try {
      Object value = null;

      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
   
      if (_valueExpr != null)
        value = _valueExpr.evalObject(pageContext.getELContext());
      else
        value = bodyContent.getString().trim();

      Object parent = getParent();
      if (! (parent instanceof ParamContainerTag))
View Full Code Here

   * Process the tag.
   */
  public int doStartTag()
    throws JspException
  {
    PageContextImpl pageContext = (PageContextImpl) this.pageContext;

    String basename = _basenameExpr.evalString(pageContext.getELContext());
     
    LocalizationContext bundle = pageContext.getBundle(basename);

    CoreSetTag.setValue(pageContext, _var, _scope, bundle);

    return SKIP_BODY;
  }
View Full Code Here

   */
  public int doStartTag()
    throws JspException
  {
    try {
      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
      ELContext env = pageContext.getELContext();

      Object valueObj = _valueExpr.evalObject(env);
      Locale locale = null;

      if (valueObj instanceof Locale) {
        locale = (Locale) valueObj;
      }
      else if (valueObj instanceof String) {
        String variant = null;

        if (_variantExpr != null)
          variant = _variantExpr.evalString(env);

        locale = pageContext.getLocale((String) valueObj, variant);
      }

      CoreSetTag.setValue(pageContext, Config.FMT_LOCALE, _scope, locale);

      return SKIP_BODY;
View Full Code Here

   * Process the tag.
   */
  public int doStartTag()
    throws JspException
  {
    PageContextImpl pc = (PageContextImpl) pageContext;

    String basename = _basenameExpr.evalString(pc.getELContext());

    _oldBundle = pc.getAttribute("caucho.bundle");
    _oldPrefix = pc.getAttribute("caucho.bundle.prefix");
   
    LocalizationContext bundle = pc.getBundle(basename);

    pc.setAttribute("caucho.bundle", bundle);

    if (_prefixExpr != null) {
      String prefix = _prefixExpr.evalString(pc.getELContext());

      pc.setAttribute("caucho.bundle.prefix", prefix);
    }
    else if (_oldPrefix != null)
      pc.removeAttribute("caucho.bundle.prefix");

    return EVAL_BODY_INCLUDE;
  }
View Full Code Here

    try {
      _iterator = null;
      _index = 0;
      _count = 0;

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

      if (_beginExpr != null)
        _begin = (int) _beginExpr.evalLong(env);
      else
        _begin = -1;

      if (_endExpr != null)
        _end = (int) _endExpr.evalLong(env);
      else
        _end = Integer.MAX_VALUE;

      if (_stepExpr != null)
        _step = (int) _stepExpr.evalLong(env);
      else
        _step = 0;
   
      String items = _itemsExpr.evalString(env);
      String delims = _delimsExpr.evalString(env);

      _iterator = new TokenIterator(items, delims);

      while (_index < _begin && _iterator.hasNext()) {
        _index++;
        _iterator.next();
      }

      if (_varStatus != null)
        pageContext.setAttribute(_varStatus, this);

      return doAfterBody();
    } catch (Exception e) {
      throw new JspException(e);
    }
View Full Code Here

      ChooseTag chooseTag = (ChooseTag) parent;

      if (chooseTag.isMatch())
        return SKIP_BODY;

      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
      boolean test = _testExpr.evalBoolean(pageContext.getELContext());

      if (test) {
        chooseTag.setMatch();
     
        return EVAL_BODY_INCLUDE;
View Full Code Here

      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
View Full Code Here

TOP

Related Classes of com.caucho.jsp.PageContextImpl$PageELContext

Copyright © 2018 www.massapicom. 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.