Examples of PageContextImpl


Examples of com.caucho.jsp.PageContextImpl

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

      TransformerFactory factory = TransformerFactory.newInstance();

      String xsltSystemId = getCanonicalURL(pageContext, _xsltSystemId);
     
      Source source = getSource(_xslt, xsltSystemId);

      Transformer transformer = factory.newTransformer(source);
      // transformer.setOutputProperty("omit-xml-declaration", "yes");

      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, getCanonicalURL(pageContext, _xmlSystemId));
      else {
        BodyContent body = getBodyContent();
       
        TempCharReader tempReader = (TempCharReader) body.getReader();
        int ch;

        while (Character.isWhitespace((ch = tempReader.read()))) {
        }

        if (ch >= 0)
          tempReader.unread();
       
        source = new StreamSource(tempReader);

        if (_xmlSystemId != null)
          source.setSystemId(getCanonicalURL(pageContext, _xmlSystemId));
        else
          source.setSystemId(((HttpServletRequest) pageContext.getRequest()).getRequestURI());
      }

      Result result;
      Node top = null;

View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

   * Returns the ML source.
   */
  private Source getSource(Object xml, String systemId)
    throws JspException
  {
    PageContextImpl pageContext = (PageContextImpl) this.pageContext;
     
    Object xmlObj = xml;
    Source source = null;

    if (xmlObj instanceof String) {
View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

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

      NumberFormat format = getFormat();

      Double rawValue = null;
      BodyContentImpl body = (BodyContentImpl) getBodyContent();
View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

  }

  protected NumberFormat getFormat()
    throws JspException
  {
    PageContextImpl pc = (PageContextImpl) pageContext;
     
    NumberFormat format = null;

    Locale locale = pc.getLocale();

    String type = _type;

    if (type == null || type.equals("") || type.equals("number")
        || _pattern != null && ! "".equals(_pattern)) {
View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

   * Process the tag.
   */
  public int doStartTag()
    throws JspException
  {
    PageContextImpl pc = (PageContextImpl) pageContext;

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

    Object valueObj = _value;
    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;
  }
View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

      args = _params.toArray(new Object[_params.size()]);
      _params = null;
    }
   
    try {
      PageContextImpl pc = (PageContextImpl) pageContext;
     
      JspWriter out = pc.getOut();

      String key = _key;

      if (_key != null) {
        key = _key;
      }
      else if (bodyContent != null) {

        String bodyString = bodyContent.getString();

        if (bodyString != null)
          key = bodyString.trim();
      }

      if (key == null)
        key = "";

      String msg;

      LocalizationContext locCtx;

      if (_bundle instanceof String) {
        locCtx = pc.getBundle((String) _bundle);
      }
      else if (_bundle instanceof LocalizationContext) {
        locCtx = (LocalizationContext) _bundle;
      }
      else if (_bundle == null) {
        locCtx
          = (LocalizationContext) pageContext.getAttribute("caucho.bundle");
      } else {
        locCtx = null;
      }

      if (locCtx == null) {
        msg = pc.getLocalizedMessage(key, args, null);
      }
      else {
        msg = pc.getLocalizedMessage(locCtx, key, args, null);

        Locale locale = locCtx.getLocale();
       
        if (locale != null)
          I18NSupport.setResponseLocale(pageContext, locale);
View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

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

      NumberFormat format = getFormat();

      String string;

View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

  }

  protected NumberFormat getFormat()
    throws JspException
  {
    PageContextImpl pc = (PageContextImpl) pageContext;
     
    NumberFormat format = null;

    Locale locale = null;

    if (_parseLocale != null) {
      Object localeObj = _parseLocale;

      if (localeObj instanceof Locale)
        locale = (Locale) localeObj;
      else if (localeObj instanceof String)
        locale = pc.getLocale((String) localeObj, null);
    }
   
    if (locale == null)
      locale = pc.getLocale();

    if (_type == null || _type.equals("") || _type.equals("number")) {
      if (locale != null)
        format = NumberFormat.getInstance(locale);
      else
View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

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

    try {
      String value = null;
      if (_value != null)
        value = _value;
View Full Code Here

Examples of com.caucho.jsp.PageContextImpl

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

      JspWriter out = pageContext.getOut();

      Node node = pageContext.getNodeEnv();

      Env env = XPath.createEnv();
      env.setVarEnv(pageContext.getVarEnv());

      String value = _select.evalString(node, env);

      env.free();

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.