Package org.apache.wicket.request.http.handler

Examples of org.apache.wicket.request.http.handler.ErrorCodeResponseHandler


          if (log.isErrorEnabled())
          {
            log.error("key: " + PAGE_CLASS + " is null.");
          }
          getRequestCycle().replaceAllRequestHandlers(
            new ErrorCodeResponseHandler(404,
              "Could not find sources for the page you requested"));
        }
        if (!pageParam.startsWith("org.apache.wicket.examples"))
        {
          if (log.isErrorEnabled())
          {
            log.error("user is trying to access class: " + pageParam +
              " which is not in the scope of org.apache.wicket.examples");
          }
          throw new UnauthorizedInstantiationException(getClass());
        }
        page = (Class<? extends Page>)Class.forName(getPageParam());
      }
      catch (ClassNotFoundException e)
      {
        getRequestCycle().replaceAllRequestHandlers(
          new ErrorCodeResponseHandler(404,
            "Could not find sources for the page you requested"));
      }
    }
    return page;
  }
View Full Code Here


    catch (RuntimeException e2)
    {
      // hmmm, we were already handling an exception! give up
      logger.error("unexpected exception when handling another exception: " + e.getMessage(),
        e);
      return new ErrorCodeResponseHandler(500);
    }

  }
View Full Code Here

    catch (RuntimeException e2)
    {
      // hmmm, we were already handling an exception! give up
      logger.error("unexpected exception when handling another exception: " + e.getMessage(),
        e);
      return new ErrorCodeResponseHandler(500);
    }
  }
View Full Code Here

    if (isProcessingAjaxRequest())
    {
      switch (application.getExceptionSettings().getAjaxErrorHandlingStrategy())
      {
        case INVOKE_FAILURE_HANDLER :
          return new ErrorCodeResponseHandler(500);
      }
    }

    if (e instanceof StalePageException)
    {
View Full Code Here

      log.warn(msg);

      if (RequestCycle.get().getResponse() instanceof WebResponse)
      {
        RequestCycle.get().replaceAllRequestHandlers(
          new ErrorCodeResponseHandler(HttpServletResponse.SC_NOT_FOUND, msg));
      }
      else
      {
        RequestCycle.get().replaceAllRequestHandlers(new AbortRequestHandler());
      }
View Full Code Here

          if (log.isErrorEnabled())
          {
            log.error("key: " + PAGE_CLASS + " is null.");
          }
          getRequestCycle().replaceAllRequestHandlers(
            new ErrorCodeResponseHandler(404,
              "Could not find sources for the page you requested"));
        }
        if (!pageParam.startsWith("org.apache.wicket.examples"))
        {
          if (log.isErrorEnabled())
          {
            log.error("user is trying to access class: " + pageParam +
              " which is not in the scope of org.apache.wicket.examples");
          }
          throw new UnauthorizedInstantiationException(getClass());
        }
        page = (Class<? extends Page>)Class.forName(getPageParam());
      }
      catch (ClassNotFoundException e)
      {
        getRequestCycle().replaceAllRequestHandlers(
          new ErrorCodeResponseHandler(404,
            "Could not find sources for the page you requested"));
      }
    }
    return page;
  }
View Full Code Here

          if (log.isErrorEnabled())
          {
            log.error("key: " + PAGE_CLASS + " is null.");
          }
          getRequestCycle().replaceAllRequestHandlers(
            new ErrorCodeResponseHandler(404,
              "Could not find sources for the page you requested"));
        }
        if (!pageParam.startsWith("org.apache.wicket.examples"))
        {
          if (log.isErrorEnabled())
          {
            log.error("user is trying to access class: " + pageParam +
              " which is not in the scope of org.apache.wicket.examples");
          }
          throw new UnauthorizedInstantiationException(getClass());
        }
        page = (Class<? extends Page>)Class.forName(getPageParam());
      }
      catch (ClassNotFoundException e)
      {
        getRequestCycle().replaceAllRequestHandlers(
          new ErrorCodeResponseHandler(404,
            "Could not find sources for the page you requested"));
      }
    }
    return page;
  }
View Full Code Here

   *            {@link javax.servlet.http.HttpServletResponse} constants
   * @see javax.servlet.http.HttpServletResponse
   */
  public AbortWithHttpErrorCodeException(int errorCode, String message)
  {
    super(new ErrorCodeResponseHandler(errorCode, message));
    this.errorCode = errorCode;
    this.message = message;
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.http.handler.ErrorCodeResponseHandler

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.