Package javax.servlet.jsp

Examples of javax.servlet.jsp.JspTagException


  } else if (TRANSACTION_REPEATABLE_READ.equals(iso)) {
      isolation = Connection.TRANSACTION_REPEATABLE_READ;
  } else if (TRANSACTION_SERIALIZABLE.equals(iso)) {
      isolation = Connection.TRANSACTION_SERIALIZABLE;
  } else {
      throw new JspTagException(
                Resources.getMessage("TRANSACTION_INVALID_ISOLATION"));
  }
    }
View Full Code Here


      pageContext.setAttribute(var, parsed, scope)
  } else {
      try {
    pageContext.getOut().print(parsed);
      } catch (IOException ioe) {
    throw new JspTagException(ioe.toString(), ioe);
      }
  }

  return EVAL_PAGE;
    }
View Full Code Here

  DataSourceWrapper ds = new DataSourceWrapper();
  try {
  ds.setDriverClassName(getDriverClassName());
  }
  catch (Exception e) {
      throw new JspTagException("Invalid driver class name: " +
    e.toString(), e);
  }
  ds.setJdbcURL(getJdbcURL());
  ds.setUserName(getUserName());
  ds.setPassword(getPassword());
View Full Code Here

    // Supply our value to our parent <fmt:message> tag
    public int doEndTag() throws JspException {
  Tag t = findAncestorWithClass(this, MessageSupport.class);
  if (t == null) {
      throw new JspTagException(Resources.getMessage(
                            "PARAM_OUTSIDE_MESSAGE"));
  }
  MessageSupport parent = (MessageSupport) t;

  /*
 
View Full Code Here

            if (TOKEN.indexOf(nextChar) != -1) {
                if (escCount == 0) {
                    paramString[aryCount] = params.substring(begin,index).trim();
                    begin = index + 1;
                    if (++aryCount > 4) {
                        throw new JspTagException(
                            Resources.getMessage("JDBC_PARAM_COUNT"));
                    }
                }
            }
            if (ESCAPE.indexOf(nextChar) != -1) {
                escCount++;
            }
            else {
                escCount = 0;
            }
        }
        paramString[aryCount] = params.substring(begin).trim();

  // use the JDBC URL from the parameter string
        dataSource.setJdbcURL(paramString[0]);

  // try to load a driver if it's present
        if (paramString[1] != null) {
            try {
                dataSource.setDriverClassName(paramString[1]);
            } catch (Exception ex) {
                throw new JspTagException(
                    Resources.getMessage("DRIVER_INVALID_CLASS",
           ex.toString()), ex);
            }
  }
View Full Code Here

   */
  if (charEncoding != null) {
      try {
    pageContext.getRequest().setCharacterEncoding(charEncoding);
      } catch (UnsupportedEncodingException uee) {
    throw new JspTagException(uee.toString(), uee);
      }
  }

  return EVAL_PAGE;
    }
View Full Code Here

      pageContext.setAttribute(var, formatted, scope)
  } else {
      try {
    pageContext.getOut().print(formatted);
      } catch (IOException ioe) {
    throw new JspTagException(ioe.toString(), ioe);
      }
  }

  return EVAL_PAGE;
    }
View Full Code Here

    if (timeZone instanceof String) {
        tz = TimeZone.getTimeZone((String) timeZone);
    } else if (timeZone instanceof TimeZone) {
        tz = (TimeZone) timeZone;
    } else {
        throw new JspTagException(
                            Resources.getMessage("FORMAT_DATE_BAD_TIMEZONE"));
    }
      } else {
    tz = TimeZoneSupport.getTimeZone(pageContext, this);
      }
      if (tz != null) {
    formatter.setTimeZone(tz);
      }
      formatted = formatter.format(value);
  } else {
      // no formatting locale available, use Date.toString()
      formatted = value.toString();
  }

  if (var != null) {
      pageContext.setAttribute(var, formatted, scope)
  } else {
      try {
    pageContext.getOut().print(formatted);
      } catch (IOException ioe) {
    throw new JspTagException(ioe.toString(), ioe);
      }
  }

  return EVAL_PAGE;
    }
View Full Code Here

  if ((key == null) || key.equals("")) {
      try {
    pageContext.getOut().print("??????");
      } catch (IOException ioe) {
    throw new JspTagException(ioe.toString(), ioe);
      }
      return EVAL_PAGE;
  }

  String prefix = null;
  if (!bundleSpecified) {
      Tag t = findAncestorWithClass(this, BundleSupport.class);
      if (t != null) {
    // use resource bundle from parent <bundle> tag
    BundleSupport parent = (BundleSupport) t;
    locCtxt = parent.getLocalizationContext();
    prefix = parent.getPrefix();
      } else {
    locCtxt = BundleSupport.getLocalizationContext(pageContext);
      }
  } else {
      // localization context taken from 'bundle' attribute
      locCtxt = bundleAttrValue;
      if (locCtxt.getLocale() != null) {
    SetLocaleSupport.setResponseLocale(pageContext,
               locCtxt.getLocale());
      }
  }
       
   String message = UNDEFINED_KEY + key + UNDEFINED_KEY;
  if (locCtxt != null) {
      ResourceBundle bundle = locCtxt.getResourceBundle();
      if (bundle != null) {
    try {
        // prepend 'prefix' attribute from parent bundle
        if (prefix != null)
      key = prefix + key;
        message = bundle.getString(key);
        // Perform parametric replacement if required
        if (!params.isEmpty()) {
      Object[] messageArgs = params.toArray();
      MessageFormat formatter = new MessageFormat(""); // empty pattern, default Locale
      if (locCtxt.getLocale() != null) {
          formatter.setLocale(locCtxt.getLocale());
      } else {
                            // For consistency with the <fmt:formatXXX> actions,
                            // we try to get a locale that matches the user's preferences
                            // as well as the locales supported by 'date' and 'number'.
                            //System.out.println("LOCALE-LESS LOCCTXT: GETTING FORMATTING LOCALE");
                            Locale locale = SetLocaleSupport.getFormattingLocale(pageContext);
                            //System.out.println("LOCALE: " + locale);
                            if (locale != null) {
                                formatter.setLocale(locale);
                            }
                        }
      formatter.applyPattern(message);
      message = formatter.format(messageArgs);
        }
    } catch (MissingResourceException mre) {
        message = UNDEFINED_KEY + key + UNDEFINED_KEY;
    }
      }
  }

  if (var != null) {
      pageContext.setAttribute(var, message, scope)
  } else {
      try {
    pageContext.getOut().print(message);
      } catch (IOException ioe) {
    throw new JspTagException(ioe.toString(), ioe);
      }
  }

  return EVAL_PAGE;
    }
View Full Code Here

     * Ensures the "begin" property is sensible, throwing an exception
     * expected to propagate up if it isn't
     */
    protected void validateBegin() throws JspTagException {
        if (begin < 0)
            throw new JspTagException("'begin' < 0");
    }
View Full Code Here

TOP

Related Classes of javax.servlet.jsp.JspTagException

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.