Package net.sf.regain

Examples of net.sf.regain.RegainException


  public String[] getParameters(String name, boolean mandatory)
    throws RegainException
  {
    String[] paramArr = getParameters(name);
    if (mandatory && ((paramArr == null) || (paramArr.length == 0))) {
      throw new RegainException("Page parameter '" + name + "' was not specified");
    } else {
      return paramArr;
    }
  }
View Full Code Here


  public String getParameter(String name, boolean mandatory)
    throws RegainException
  {
    String asString = getParameter(name);
    if (mandatory && (asString == null)) {
      throw new RegainException("Page parameter '" + name + "' was not specified");
    } else {
      return asString;
    }
  }
View Full Code Here

    } else {
      try {
        return Integer.parseInt(asString);
      }
      catch (NumberFormatException exc) {
        throw new RegainException("Parameter '" + name + "' must be a number: "
            + asString);
      }
    }
  }
View Full Code Here

      // response.close();
     
      switch (result) {
        case SharedTag.EVAL_TAG_BODY: return EVAL_BODY_TAG;
        case SharedTag.SKIP_TAG_BODY: return SKIP_BODY;
        default: throw new RegainException("printStartTag must return either " +
            "EVAL_TAG_BODY or SKIP_TAG_BODY");
      }
    }
    catch (RegainException exc) {
      throw new ExtendedJspException("Writing results failed", exc);
View Full Code Here

    try {
      int result = mNestedTag.printAfterBody(request, response);
      switch (result) {
        case SharedTag.EVAL_TAG_BODY: return EVAL_BODY_TAG;
        case SharedTag.SKIP_TAG_BODY: return SKIP_BODY;
        default: throw new RegainException("printAfterBody must return either " +
            "EVAL_TAG_BODY or SKIP_TAG_BODY");
      }
    }
    catch (RegainException exc) {
      throw new ExtendedJspException("Writing results failed", exc);
View Full Code Here

  public OutputStream getOutputStream() throws RegainException {
    try {
      return mServletResponse.getOutputStream();
    }
    catch (IOException exc) {
      throw new RegainException("Getting the response OutputStream failed", exc);
    }
  }
View Full Code Here

      }

      mJspWriter.print(text);
    }
    catch (IOException exc) {
      throw new RegainException("Writing results failed", exc);
    }
  }
View Full Code Here

  public void sendRedirect(String url) throws RegainException {
    try {
      mServletResponse.sendRedirect(url);
    }
    catch (IOException exc) {
      throw new RegainException("Sending redirect to '" + url + "' failed", exc);
    }
  }
View Full Code Here

  public void sendError(int errorCode) throws RegainException {
    try {
      mServletResponse.sendError(errorCode);
    }
    catch (IOException exc) {
      throw new RegainException("Sending error code " + errorCode + " failed", exc);
    }
  }
View Full Code Here

      try {
        mBaseUrl = mPageContext.getServletContext().getResource("/");
        System.out.println("mBaseUrl: " + mBaseUrl);
      }
      catch (MalformedURLException exc) {
        throw new RegainException("Getting base URL failed", exc);
      }
    }
    return mBaseUrl;
  }
View Full Code Here

TOP

Related Classes of net.sf.regain.RegainException

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.