Package com.caucho.jsp

Examples of com.caucho.jsp.PageContextImpl$PageELContext


    com.caucho.jstl.rt.CoreUrlTag.addParam(_url, name, value, encoding);
  }

  public int doStartTag() throws JspException
  {
    PageContextImpl pageContext = (PageContextImpl) this.pageContext;
 
    String value = _valueExpr.evalString(pageContext.getELContext());
    String context = null;

    if (_contextExpr != null)
      context = _contextExpr.evalString(pageContext.getELContext());
   
    _url = normalizeURL(pageContext, value, context);

    return EVAL_BODY_INCLUDE;
  }
View Full Code Here


    return EVAL_BODY_INCLUDE;
  }
     
  public int doEndTag() throws JspException
  {
    PageContextImpl pageContext = (PageContextImpl) this.pageContext;
 
    String value = encodeURL(pageContext, _url);

    try {
      if (_var == null) {
        JspWriter out = pageContext.getOut();

        out.print(value);
      }
      else
        CoreSetTag.setValue(pageContext, _var, _scope, value);
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;
   
      Object items = null;

      if (_itemsExpr != null) {
  items = _itemsExpr.evalObject(env);

  _iterator = getIterator(items);

  while (_index < _begin && _iterator.hasNext()) {
    _index++;
    _iterator.next();
  }
      }
      else if (_beginExpr == null)
  throw new JspException(L.l("c:forEach must specify `items' or `begin'"));
      else if (_endExpr == null)
  throw new JspException(L.l("c:forEach must specify `items' or `begin'"));
      else {
  _iterator = new RangeIterator(_begin, _end);
  _end = -1;
      }

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

      if (_var != null)
  _initialVar = pageContext.getAttribute(_var);

      return doAfterBody();
    } catch (Exception e) {
      throw new JspException(e);
    }
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.