Package com.caucho.jsp

Examples of com.caucho.jsp.PageContextImpl


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

      Object value = _valueExpr.evalObject(pageContext.getELContext());

      if (value == null) {
        if (_var != null)
          CoreSetTag.setValue(pageContext, _var, _scope, null);
     
        return EVAL_PAGE;
      }

      long time = 0;

      if (value instanceof Number)
        time = ((Number) value).longValue();
      else if (value instanceof Date)
        time = ((Date) value).getTime();
     
      DateFormat format = null;

      Locale locale = pageContext.getLocale();

      String type = null;

      ELContext env = pageContext.getELContext();

      if (_typeExpr != null)
        type = _typeExpr.evalString(env);

      int dateStyle = DateFormat.DEFAULT;
View Full Code Here


  private TimeZone getTimeZone()
    throws ELException
  {
    if (_timeZoneExpr != null) {
      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
      Object timeZoneObj = _timeZoneExpr.evalObject(pageContext.getELContext());

      TimeZone zone = getTimeZone(timeZoneObj);
      if (zone != null)
        return zone;
    }

    Object timeZoneObj = pageContext.getAttribute("com.caucho.time-zone");

    if (timeZoneObj != null)
      return (TimeZone) timeZoneObj;

    timeZoneObj = Config.find(pageContext, Config.FMT_TIME_ZONE);
View Full Code Here

      ChooseTag chooseTag = (ChooseTag) parent;

      if (chooseTag.isMatch())
        return SKIP_BODY;

      PageContextImpl pageContext = (PageContextImpl) this.pageContext;

      Env env = XPath.createEnv();
      env.setVarEnv(pageContext.getVarEnv());
     
      Node node = pageContext.getNodeEnv();
     
      boolean test = _select.evalBoolean(node, env);

      env.free();
View Full Code Here

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

    try {
      String value = null;
      if (_valueExpr != null)
        value = _valueExpr.evalString(pageContext.getELContext());
      else
        value = (String) Config.find(pageContext, "javax.servlet.jsp.jstl.fmt.request.charset");

      if (value != null && ! value.equals(""))
        request.setCharacterEncoding(value);
View Full Code Here

  }

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

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

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

    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

  }

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

      Reader reader;

      if (_xml != null) {
        Object obj = _xml.evalObject(pageContext.getELContext());

        if (obj instanceof Reader)
          reader = (Reader) obj;
        else if (obj instanceof String)
          reader = Vfs.openString((String) obj).getReader();
View Full Code Here

    throws JspException
  {
    if (_valueExpr == null)
      return EVAL_BODY_BUFFERED;

    PageContextImpl pageContext = (PageContextImpl) this.pageContext;
   
    Object value = _valueExpr.evalObject(pageContext.getELContext());

    Tag parent = getParent();
    for (;
         parent != null && ! (parent instanceof SQLExecutionTag);
         parent = parent.getParent()) {
View Full Code Here

TOP

Related Classes of com.caucho.jsp.PageContextImpl

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.