Package org.apache.wicket

Examples of org.apache.wicket.RestartResponseException


        final AbstractDefaultAjaxBehavior newNav = new AbstractDefaultAjaxBehavior() {
            @Override
            protected void respond(AjaxRequestTarget target) {
                System.out.println("newNav");
                throw new RestartResponseException(PasteItemPage.class);
            }
        };
        add(newNav);

        final AbstractDefaultAjaxBehavior historyNav = new AbstractDefaultAjaxBehavior() {
            @Override
            protected void respond(AjaxRequestTarget target) {
                System.out.println("historyNav");
                throw new RestartResponseException(HistoryPage.class);
            }
        };
        add(historyNav);

//        mousetrap.addBind(new KeyBinding().addKeyCombo("n").addKeyCombo("N"), newNav);
View Full Code Here


        IRequestParameters params = getRequestCycle().getRequest().getQueryParameters();
        String pw = pasteService.getAdminPassword();
        if(pw == null || params.getParameterValue("pw").isEmpty() ||
                !params.getParameterValue("pw").toString().equals(pw)) {
            throw new RestartResponseException(AccessDeniedPage.class);
        }

        itemsPerPage = params.getParameterValue("itemsPerPage").toInt(ITEMS_PER_PAGE);
/*
        if(!params.getParameterValue("itemsPerPage").isEmpty()) {
View Full Code Here

        final String oidStr = (String) event.getEvent().getPayload();
        final RootOid oid = RootOidDefault.deString(oidStr, IsisContext.getOidMarshaller());
        final ObjectAdapter adapter = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(oid);
        final PageParameters params = new EntityModel(adapter).asPageParameters();
        throw new RestartResponseException(EntityPage.class, params);
    }
View Full Code Here

                    if(requestHandler.getPage() instanceof ErrorPage) {
                        // do nothing
                        return;
                    }
                }
                throw new RestartResponseException(errorPageProviderFor(ex), RedirectPolicy.ALWAYS_REDIRECT);
            }
        }
    }
View Full Code Here

  {
    // logon successful. Continue to the original destination
    continueToOriginalDestination();

    // Ups, no original destination. Go to the home page
    throw new RestartResponseException(getApplication().getHomePage());
  }
View Full Code Here

  protected void onSignInRemembered() {
    // logon successful. Continue to the original destination
    continueToOriginalDestination();

    // Ups, no original destination. Go to the home page
    throw new RestartResponseException(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<? 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

          password = data[1];

          // logon successful. Continue to the original destination
          continueToOriginalDestination();
          // Ups, no original destination. Go to the home page
          throw new RestartResponseException(getSession().getPageFactory().newPage(
            getApplication().getHomePage()));
        }
        else
        {
          // the loaded credentials are wrong. erase them.
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(getSession().getPageFactory().newPage(
              getApplication().getHomePage()));
          }
        }
        else
        {
View Full Code Here

  /**
   * Construct.
   */
  public HomePageClassRedirect()
  {
    throw new RestartResponseException(RedirectPage.class);
  }
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.