Package com.caucho.jsp

Examples of com.caucho.jsp.PageContextImpl$PageELContext


   */
  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


  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

   */
  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

  }

  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

   */
  public int doStartTag()
    throws JspException
  {
    try {
      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
   
      boolean test = _testExpr.evalBoolean(pageContext.getELContext());
      Boolean value = test ? Boolean.TRUE : Boolean.FALSE;

      if (_var == null) {
      }
      else
View Full Code Here

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

      String string;

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

View Full Code Here

  }

  protected DateFormat getFormat()
    throws JspException, ELException
  {
    PageContextImpl pageContext = (PageContextImpl) this.pageContext;
    ELContext env = pageContext.getELContext();
   
    DateFormat 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

  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

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.