Examples of PageContextImpl


Examples of com.caucho.jsp.PageContextImpl

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

      Object valueObj = _valueExpr.evalObject(pageContext.getELContext());
      TimeZone timeZone = null;

      if (valueObj instanceof TimeZone) {
        timeZone = (TimeZone) valueObj;
      }
View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

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

      double number;

      BodyContentImpl body = (BodyContentImpl) getBodyContent();

View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

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

      Locale locale = pageContext.getLocale();

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

Examples of com.caucho.jsp.PageContextImpl

   */
  public int doStartTag()
    throws JspException
  {
    try {
      PageContextImpl pc = (PageContextImpl) pageContext;

      _oldTimeZone = pc.getAttribute("com.caucho.time-zone");

      Object valueObj = _valueExpr.evalObject(pc.getELContext());
      TimeZone timeZone = null;

      if (valueObj instanceof TimeZone) {
        timeZone = (TimeZone) valueObj;
      }
      else if (valueObj instanceof String) {
        String string = (String) valueObj;
        string = string.trim();

        if (string.equals(""))
          timeZone = TimeZone.getTimeZone("GMT");
        else
          timeZone = TimeZone.getTimeZone(string);
      }
      else
        timeZone = TimeZone.getTimeZone("GMT");

      pc.setAttribute("com.caucho.time-zone", timeZone);

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

Examples of com.caucho.jsp.PageContextImpl

  public int doEndTag() throws JspException
  {
    Connection conn = null;
    boolean isTransaction = false;
    PageContextImpl pageContext = (PageContextImpl) this.pageContext;
    ELContext env = pageContext.getELContext();
   
    try {
      String sql;

      if (_sql != null)
        sql = _sql.evalString(env);
      else
        sql = bodyContent.getString();

      conn = (Connection) pageContext.getAttribute("caucho.jstl.sql.conn");
      if (conn != null)
        isTransaction = true;

      if (! isTransaction) {
        DataSource ds;
View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

   */
  public int doStartTag()
    throws JspException
  {
    try {
      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
      Env env = XPath.createEnv();
      env.setVarEnv(pageContext.getVarEnv());
     
      _oldEnv = pageContext.getNodeEnv();
      Object obj = _select.evalObject(_oldEnv, env);

      env.free();

      if (obj == null)
        return SKIP_BODY;

      if (obj instanceof Iterator)
        _iterator = (Iterator) obj;
      else if (obj instanceof Collection)
        _iterator = ((Collection) obj).iterator();
      else if (obj instanceof NodeList) {
        NodeList nodeList = (NodeList) obj;
        ArrayList<Object> list = new ArrayList<Object>();

        for (int i = 0;  i < nodeList.getLength(); i++)
          list.add(nodeList.item(i));

        _iterator = list.iterator();
      }
      else {
        ArrayList<Object> list = new ArrayList<Object>();
        list.add(obj);

        _iterator = list.iterator();
      }

      _count = 0;

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

      if (_end < _count || ! _iterator.hasNext())
        return SKIP_BODY;

      _current = _iterator.next();
      Object value = _current;
      _count++;

      if (_var != null)
        pageContext.setAttribute(_var, value);

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

      if (value instanceof Node)
        pageContext.setNodeEnv((Node) value);

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

Examples of com.caucho.jsp.PageContextImpl

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

    int step = _step;
   
    Object value = null;
   
    do {
      if (_end < _count || ! _iterator.hasNext()) {
        pageContext.setNodeEnv(_oldEnv);
       
        if (_var != null)
          pageContext.removeAttribute(_var);
       
        if (_varStatus != null)
          pageContext.removeAttribute(_varStatus);
       
        return SKIP_BODY;
      }

      value = _iterator.next();
      _count++;
    } while (--step > 0);
   
    _current = value;

    if (_var != null)
      pageContext.setAttribute(_var, value);
    if (value instanceof Node)
      pageContext.setNodeEnv((Node) value);

    return EVAL_BODY_AGAIN;
  }
View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

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

      boolean doEscape = (_escapeXml == null || _escapeXml.evalBoolean(env));
     
      if (! _value.print(out, env, doEscape)) {
      }
View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

  }

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

      if (body != null) {
        boolean doEscape = (_escapeXml == null || _escapeXml.evalBoolean(env));
View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

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

      TransformerFactory factory = TransformerFactory.newInstance();

      Source source = getSource(_xslt, _xsltSystemId);

      Transformer transformer = factory.newTransformer(source);

      for (int i = 0; i < _paramNames.size(); i++) {
        String name = _paramNames.get(i);
        String value = _paramValues.get(i);

        transformer.setParameter(name, value);
      }

      if (_xml != null)
        source = getSource(_xml, _xmlSystemId);
      else {
        BodyContent bodyContent = getBodyContent();

        source = new StreamSource(bodyContent.getReader());
        source.setSystemId(((HttpServletRequest) pageContext.getRequest()).getRequestURI());
      }

      Result result;
      Node top = null;

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.