Package org.zkoss.lang

Examples of org.zkoss.lang.SystemException


        _extctx = Servlets.getExtendletContext(svlctx, ctxroot.substring(1));
        if (_extctx == null) {
          _svlctx = svlctx;
          _svlctx = _svlctx.getContext(ctxroot);
          if (_svlctx == null)
            throw new SystemException("Context not found or not visible to "+ctx+": "+ctxroot);
        }
      } else {
        _prtctx = ctx;
        _uri = uri;
      }
View Full Code Here


    final Object clsnm;
    synchronized (_evals) {
      clsnm = _evals.get(evalnm);
    }
    if (clsnm == null)
      throw new SystemException("Evaluator not found: " + name);

    if (clsnm instanceof Class) {
      return (Class)clsnm;
    } else {
      try {
        return Classes.forNameByThread((String)clsnm);
      } catch (ClassNotFoundException ex) {
        throw new SystemException("Failed to load class "+clsnm);
      }
    }
  }
View Full Code Here

        _enc = new URLEncoder() {
          public String encode(String s) {
            try {
              return java.net.URLEncoder.encode(s, "UTF-8");
            } catch (java.io.UnsupportedEncodingException ex) {
              throw new SystemException(ex);
            }
          }
        };
      }
    }
View Full Code Here

   */
  public static final String getRequiredLabel(String key)
  throws SystemException {
    final String s = getLabel(key);
    if (s == null)
      throw new SystemException("label not found: "+key);
    return s;
  }
View Full Code Here

   * @since 3.0.6
   */
  public static final String getRequiredLabel(String key, Object[] args) {
    final String s = getLabel(key);
    if (s == null)
      throw new SystemException("label not found: "+key);
    return MessageFormats.format(s, args, null);
  }
View Full Code Here

  public static final String getCompleteServerName(HttpServletRequest hreq) {
    final StringBuffer sb = hreq.getRequestURL();
    final String ctx = hreq.getContextPath();
    final int j = sb.indexOf(ctx);
    if (j < 0)
      throw new SystemException("Unknown request: url="+sb+", ctx="+ctx);
    return sb.delete(j, sb.length()).toString();
  }
View Full Code Here

  public static final String getCompleteContext(HttpServletRequest hreq) {
    final StringBuffer sb = hreq.getRequestURL();
    final String ctx = hreq.getContextPath();
    final int j = sb.indexOf(ctx);
    if (j < 0)
      throw new SystemException("Unknown request: url="+sb+", ctx="+ctx);
    return sb.delete(j + ctx.length(), sb.length()).toString();
  }
View Full Code Here

    try {
      URL url = _ctx.getResource(fixName(name, true));
      return url == null && _prefix != null ?
        _ctx.getResource(fixName(name, false)): url;
    } catch (java.net.MalformedURLException ex) {
      throw new SystemException(ex);
    }
  }
View Full Code Here

    else if (path.charAt(0) != '/') {
      if (path.indexOf("://") > 0) {
        try {
          url = new URL(path);
        } catch (java.net.MalformedURLException ex) {
          throw new SystemException(ex);
        }
      }else path = '/' + path;
    }

    if (url == null) {
View Full Code Here

        return Encodes.addToQueryString(sb, params).toString();
      default:
        throw new IllegalArgumentException("Unknown mode: "+mode);
      }
    } catch (UnsupportedEncodingException ex) {
      throw new SystemException(ex);
    }
  }
View Full Code Here

TOP

Related Classes of org.zkoss.lang.SystemException

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.