Package org.apache.wicket

Examples of org.apache.wicket.RestartResponseException


  }
 
  public static <T> T getBean(Class<T> clazz) {
    if (InitializationContainer.initComplete) {
      if (!isInstalled()) {
        throw new RestartResponseException(InstallWizardPage.class);
      }
      return get()._getBean(clazz);
    } else {
      throw new RestartResponseException(NotInitedPage.class);
    }
  }
View Full Code Here


    private void alreadyLoggedIn() {
      // logon successful. Continue to the original destination
      continueToOriginalDestination();
      // Ups, no original destination. Go to the home page
      throw new RestartResponseException(Application.get().getHomePage());
    }
View Full Code Here

    final Page responsePage = requestCycle.getResponsePage();

    Page override = onRuntimeException(responsePage, e);
    if (override != null)
    {
      throw new RestartResponseException(override);
    }
    else if (e instanceof AuthorizationException)
    {
      // are authorization exceptions always thrown before the real
      // render?
      // else we need to make a page (see below) or set it hard to a
      // redirect.
      Class accessDeniedPageClass = application.getApplicationSettings()
          .getAccessDeniedPage();

      throw new RestartResponseAtInterceptPageException(accessDeniedPageClass);
    }
    else if (e instanceof PageExpiredException)
    {
      Class pageExpiredErrorPageClass = application.getApplicationSettings()
          .getPageExpiredErrorPage();
      throw new RestartResponseException(pageExpiredErrorPageClass);
    }
    else if (settings.getUnexpectedExceptionDisplay() != IExceptionSettings.SHOW_NO_EXCEPTION_PAGE)
    {
      // we do not want to redirect - we want to inline the error output
      // and preserve the url so when the refresh button is pressed we
      // rerun the code that caused the error
      requestCycle.setRedirect(false);

      // figure out which error page to show
      Class internalErrorPageClass = application.getApplicationSettings()
          .getInternalErrorPage();
      Class responseClass = responsePage != null ? responsePage.getClass() : null;

      if (responseClass != internalErrorPageClass
          && settings.getUnexpectedExceptionDisplay() == IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE)
      {
        throw new RestartResponseException(internalErrorPageClass);
      }
      else if (responseClass != ExceptionErrorPage.class)
      {
        // Show full details
        throw new RestartResponseException(new ExceptionErrorPage(e, responsePage));
      }
      else
      {
        // give up while we're ahead!
        throw new WicketRuntimeException("Internal Error: Could not render error page "
View Full Code Here

      MySession sess = MySession.get();
      if (sess.getName() != null)
      {
        Session.get().invalidateNow();
        throw new RestartResponseException(getClass());
        // throw new AbortException();
      }
    }
View Full Code Here

    final Page responsePage = requestCycle.getResponsePage();

    Page override = onRuntimeException(responsePage, e);
    if (override != null)
    {
      throw new RestartResponseException(override);
    }
    else if (e instanceof AuthorizationException)
    {
      // are authorization exceptions always thrown before the real
      // render?
      // else we need to make a page (see below) or set it hard to a
      // redirect.
      Class<? extends Page> accessDeniedPageClass = application.getApplicationSettings()
        .getAccessDeniedPage();

      throw new RestartResponseAtInterceptPageException(accessDeniedPageClass);
    }
    else if (e instanceof PageExpiredException)
    {
      Class<? extends Page> pageExpiredErrorPageClass = application.getApplicationSettings()
        .getPageExpiredErrorPage();
      boolean mounted = isPageMounted(pageExpiredErrorPageClass);
      RequestCycle.get().setRedirect(mounted);
      throw new RestartResponseException(pageExpiredErrorPageClass);
    }
    else if (settings.getUnexpectedExceptionDisplay() != IExceptionSettings.SHOW_NO_EXCEPTION_PAGE)
    {
      // we do not want to redirect - we want to inline the error output
      // and preserve the url so when the refresh button is pressed we
      // rerun the code that caused the error
      // However we don't what to do this in a situation where we are in portlet mode
      if (!RequestContext.get().isPortletRequest())
      {
        requestCycle.setRedirect(false);
      }

      // figure out which error page to show
      Class<? extends Page> internalErrorPageClass = application.getApplicationSettings()
        .getInternalErrorPage();
      Class<? extends Page> responseClass = responsePage != null ? responsePage.getClass()
        : null;

      if (responseClass != internalErrorPageClass &&
        settings.getUnexpectedExceptionDisplay() == IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE)
      {
        throw new RestartResponseException(internalErrorPageClass);
      }
      else if (responseClass != ExceptionErrorPage.class)
      {
        // Show full details
        throw new RestartResponseException(new ExceptionErrorPage(e, responsePage));
      }
      else
      {
        // give up while we're ahead!
        throw new WicketRuntimeException("Internal Error: Could not render error page " +
View Full Code Here

      {
        // we haven't done the redirect yet; record that we will be
        // doing that now and redirect
        session.setMetaData(BROWSER_WAS_POLLED_KEY, Boolean.TRUE);
        String url = "/" + getRequest().getURL();
        throw new RestartResponseException(new BrowserInfoPage(url));
      }
      // if we get here, the redirect already has been done; clear
      // the meta data entry; we don't need it any longer is the client
      // info object will be cached too
      session.setMetaData(BROWSER_WAS_POLLED_KEY, (Boolean)null);
View Full Code Here

          // logon successful. Continue to the original destination
          if (!continueToOriginalDestination())
          {
            // Ups, no original destination. Go to the home page
            throw new RestartResponseException(getApplication().getSessionSettings()
              .getPageFactory()
              .newPage(getApplication().getHomePage()));
          }
        }
      }
View Full Code Here

      MySession sess = MySession.get();
      if (sess.getName() != null)
      {
        Session.get().invalidateNow();
        throw new RestartResponseException(getClass());
        // throw new AbortException();
      }
    }
View Full Code Here

      {
        // we haven't done the redirect yet; record that we will be
        // doing that now and redirect
        session.setMetaData(BROWSER_WAS_POLLED_KEY, Boolean.TRUE);
        String url = "/" + getRequest().getURL();
        throw new RestartResponseException(newBrowserInfoPage(url));
      }
      // if we get here, the redirect already has been done; clear
      // the meta data entry; we don't need it any longer is the client
      // info object will be cached too
      session.setMetaData(BROWSER_WAS_POLLED_KEY, (Boolean)null);
View Full Code Here

    private void alreadyLoggedIn() {
      // logon successful. Continue to the original destination
      continueToOriginalDestination();
      // Ups, no original destination. Go to the home page
      throw new RestartResponseException(Application.get().getHomePage());
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.RestartResponseException

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.