Package org.apache.wicket

Examples of org.apache.wicket.RestartResponseException


                    }
                }
               
                // shouldn't return null given that we're in a session ...
                PageProvider errorPageProvider = errorPageProviderFor(ex);
                throw new RestartResponseException(errorPageProvider, RedirectPolicy.ALWAYS_REDIRECT);
            }
        }
    }
View Full Code Here


      public void onSubmit() {
        sortableListView.getModel().detach();
        sortableListView.removeAll();
       
        SortablePanel.this.setSortMode(false);
        throw new RestartResponseException(getPage());
      }
    };
    add(form);
   
    // List view
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

    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();
      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
      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

          // 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

    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();
      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
      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

    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

    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
      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

      {
        // 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

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.